Separating the Wayland compositor and window manager (isaacfreund.com)

by dpassens 221 comments 344 points
Read article View on HN

221 comments

[−] _flux 62d ago
To me, this is the first time Wayland feels like it's not a waste of time. The display server does not need to have the complexity of window managing on top the surface management. I certainly share the author's sentiment:

> Although, I do not know for sure why the original Wayland authors chose to combine the window manager and Wayland compositor, I assume it was simply the path of least resistance.

Although I'm not sure if it was the least resistance per se (as a social phenomenon), but just that it's an easier problem to tackle. Or maybe the authors means the same thing.

(That and the remote access story needs to be fixed. It just works in X11. Last time I tried it with a system that had 90 degree display orientation, my input was 90 degrees off from the real one. Now, this is of course just a bug, but I have a strong feeling that the way architecture Wayland has been built makes these kind of bugs much easier to create than in X11.)

[−] toast0 62d ago
X11 has some tricky, imposible to fix (within the confines of the existing protoco) issues because of the seperation between Xserver and window manager. Things like (IIRC) initial window placement and what nots, where ideally the window manager would make choices about things before the process continues, but the reality of distributed systems makes everything hard. Combining some things into an integrated process fixes that, but comes with other issues.

There were probably other ways to fix those issues, but it would still be a fair amount of churn.

[−] vidarh 61d ago

> imposible to fix (within the confines of the existing protoco)

X11's extension mechanisms can - and has - been used to enable backwards incompatible protocol changes. E.g. BigRequest changes the length and format of every single protocol request.

Very few client libraries are only capable of speaking "the existing" protocol if you take that to mean the original unextended X11 protocol.

Adding an X11 extension that when enabled cleans up a lot of cruft would not have been a problem.

> where ideally the window manager would make choices about things before the process continues

Nothing stops you from introducing an extension that when enabled requires the client to wait for a new notification type before continuing, or re-defines behaviour. That said, using my own custom window manager, I don't know what you mean here. My WM does decide the initial window placement and size, and it's the clients damn problem if it can't handle a resize before I allow the window to be mapped.

The X protocol is crusty in places, but it is very flexible. People haven't fixed these things because they chose to invent compatibility hindrances that weren't real when their response was to invent an entirely new protocol with no compatibility at all.

[−] vidarh 61d ago
Too late to edit, but one minor self-correction: BigRequest changes the allowed length and format of every single protocol request. For small requests they are the same, but if length is set to 0, an extra 4 octets are inserted to allow encoding a larger packet length.
[−] ahartmetz 61d ago
Inverse second system effect: Doing everything problematic about the first system in the exact opposite way.
[−] FooBarWidget 61d ago
I think it's quite ironic that everybody nowadays complains about Wayland and the "good old days" of X. Back in the day, everybody and their dog complained about X being "archaic", "slow", "takes 20 operations to draw a line", etc. XComposite and XRender were just hacks. Everybody hated on X and anything else was considered better.

On a tangent, also very ironic that X (the successor of Twitter) has the exact same logo as X (the window system). It's like Elon Musk just Googled for the first X logo that came along and appropriated that and nobody seems to notice or care.

[−] ForHackernews 61d ago
They both appropriated the "blackboard bold" X https://www.popularmechanics.com/technology/apps/a44641211/t...
[−] rendaw 62d ago
I think most smaller Wayland compositors are using a library (wlroots, smithay) for most (?) of the compositing. If using a library provides a few extra options, while still allowing sharing code, it feel like the API boundary was put in the right place.

When there was the 90deg off bug, was that a bug in the compositor or in wlroots?

[−] hedgehog 62d ago
Remote access on X11 is a mess and I won't miss it, at least on Wayland everyone is funneled through EGL or Vulkan and there's a reasonable path to layering remote access on top of that.
[−] GuB-42 61d ago
X11 remote access have worked really well for me. And the best part is that it worked even when the client machine has no graphical subsystem installed. I can launch GUI applications remotely with a non-privileged account and it shows on my machine as if it was native.

Wayland can use RDP and some other remote desktop protocols, but it is not what I want, I want a window, not a desktop. There is Waypipe now, I heard it works fine now, but I am still doing "ssh -X", because it just works.

The problem with Wayland is that it is very much "batteries not included". To all the things that worked well in X11, the response has been "it can be done, our protocol is very flexible, ask the guys writing the compositor", not "that's how is done". The result, Wayland is 18 years old and it is only starting to work well, with some pain points still remaining, and display forwarding is one of them.

It is funny you mention a "reasonable path" by the way, as it is exactly that problem, I don't want a "reasonable path", I want it to work, and after 18 years, I think it is a reasonable expectation. To their credit, it seems we are getting there: waypipe, and now window managers, we may finally have feature parity.

[−] ACS_Solver 61d ago
This is also where I'm at. I don't care what protocol or whatever is running underneath but I just want things to work and Wayland doesn't do that. It has lately been better, previously I would try Wayland and run into problems within minutes, recent attempts have given me hours without running into a problem. And as an end user I don't want to care that the problems I get aren't with Wayland but rather a particular compositor/WM implementation or whatever. I want it to work but it's only in the last year or so that basic functionality like screenshots has become reliable.

What gets me is how old Wayland is. It's now older than Linux itself was when Wayland started. It started in the era of 2.6 kernel series, when most software was still 32-bit, systemd didn't exist, when Motora Razr was more common than iPhones, when native desktop applications were still the norm, Node.js didn't yet exist and Google Chrome was a completely new beta browser. Wayland is now reaching feature parity and some kind of "it works out of the box, usually" state when it's from a completely different era of computing.

The nearest point of comparison is perhaps systemd, another Linux project that is very large in scope, complicated, critical and must interface well with lots of pre-existing software. Four years after Poeterring's "Rethinking PID 1" post that introduced systemd, it was enabled and in use on many distros. The conservative Debian adopted it within five years. Now it's been clearly a major success, but Wayland has been perhaps the slowest serious software product to be in development.

[−] prmoustache 61d ago
You have some weird memory, screenshots have been a solved issue for something like 6 or 7 years at the very least, if not a decade. I remember taking screenshots on wayland during the Covid era for instance.
[−] blacklion 61d ago
And I want (wanted) both. And X11 cannot redirect whole display server until you start your session with some Xnest or other semi-standard middleware (nx?).

It is very convenient sometimes to access your locked session on big desktop from small laptop, do something, and later go to big desktop physically and unlock "local" termianl and continue with all same programs and windows without starting new session. This scenario were not supported by X11 very well, unfortunately.

[−] hedgehog 61d ago
I'll take a reasonable path over no path and just hoping VirtualGL or something will be enough and forgoing color management entirely. I understand that some use cases work better or only in X, but I also see the roadmap for Wayland and it looks like it will solve problems that I care about. While I know a little bit about graphics and GUIs, the people building all this infrastructure know much more and it seems likely that their judgement on how to solve these problems is on average better than people who haven't been working at that layer for a few years.
[−] hsbauauvhabzb 61d ago

> Although I'm not sure if it was the least resistance per se (as a social phenomenon), but just that it's an easier problem to tackle. Or maybe the authors means the same thing.

Or maybe it’s desktop environments pulling the ladder up behind them.

[−] jbritton 62d ago
On X11, the window manager handles the window decorations. So splitting them is going to involve some possibly non-trivial messaging and config.
[−] ximm 61d ago
I don't get the frustration with wayland (the protocol) in the comments. This project shows that having a separate window manager was always possible. First we got wlroots as a library that did most of the heavy lifting, and now we got river as an even higher level abstraction.

Sure I agree that wayland (the project) could have provided these abstractions much earlier. But anyone else could have done it, too. We get all of this for free, so we shouldn't complain if other people don't do the work that we could do just as well.

[−] akagusu 62d ago
Well, it only took 15 years to someone to fix one of many Wayland design flaws and start to make it feel usable.

Now it will take another 15 years for people to settle down in a set of common protocols instead of writing their own extension protocols and others 15 years for window managers to mature at the same level of the X11 window managers.

Then, people who think they know better than everyone else will throw Wayland away and start from zero all over again.

[−] kyorochan 62d ago
River was really great even before this split, so I'm very excited to see what happens in the space in the future. I switched to Niri while waiting for it to happen, and I'll probably switch back at some point.

If you were an Xmonad user I feel pretty confident in saying River is the Wayland WM for you.

[−] oofbaroomf 62d ago
I'm currently using a fully vibe-coded, personal River window manager that works just how I want it to. I switched to it after I realized I couldn't do everything I wanted in Hyprland (e.g. tile windows to equal areas instead of BSP by default).

Simple example of how impactful this separation has been for me.

[−] bandrami 62d ago
As predicted, we will re-invent X11 one feature at a time. Maybe someday soon a Wayland window will be able to know its own screen position.
[−] wild_egg 62d ago
I've never used a system with Wayland (been on i3 for ~15 years) but every time a project like this comes up, I have to wonder why Wayland is even a thing. So many hoops to jump through for things that should be simple.

Sure, X11 has warts but I can make it do basically anything I want. Wayland seems like it will always have too much friction to ever consider switching.

[−] csb6 62d ago
Wasn't one of Wayland's key design features combining the window manager and compositor? I am not too familiar with its history but surely there have been presentations or papers about the Wayland designers' reasoning for doing so.
[−] throwthro0954 61d ago
As a 25 year user of Linux I love wayland since cutting over to it about 5 years ago. No tearing ever, which I always had to battle with with X. Certain developers that must interact with the Wayland stack will have to do more work now, and some projects may not still be viable, I get it. I've been following the comments in Linux forums for years. But users exist too, and here is one data point for you.
[−] asveikau 62d ago
The fact that Wayland can't just substitute out pluggable WMs without changing a bunch of other unrelated infrastructure is IMO one of the biggest user-facing losses relative to X11. Anybody who is working to improve that is doing god's work as they say.
[−] hedora 62d ago
Traditionally, X11 didn’t have compositors, and didn’t need the extra round trip wayland exists to remove.

I wonder if there’s space for a project like xlibre (or x.org, if it were revived) to update the x11 protocol to fill whatever gap compositors were meant to fill.

For what it’s worth, I’ve been moving all my machines to lxde.

Apparently, I accidentally switched back to a compositor free desktop without noticing. High framerate, vsync/tear-free and high dpi work fine. So does fractional scaling, but I disable it.

Personally, I’d rather these hypothetical x11 devs focused on reverse engineering hdmi vrr (blocked by lawyers at the moment), and HDR / expanded color spaces.

[−] hparadiz 62d ago
Lots of weird misinformation in the comments here. Wayland doesn't choose anything. It leaves the compositor to decide where to position a window and whether or not that window receives key presses or not. The program can't draw wherever it wants or receive system wide keystrokes or on behalf of another program. When appropriately implemented the screenshot system is built directly into the compositor. It's an API that let's a program request read access to a part of the screen and the compositor provides upon approval. It's much more secure that way and it works perfectly fine these days. Unfortunately not every compositor implements this.

However if you really really really wanna side step this you can look at keyd - https://github.com/rvaiya/keyd

A project that has a daemon run in the background as a root service and that can provide an appropriate shim to pass key strokes to anything you want.

And just to be clear the appropriate secure model is to have a program request to register a "global" hot key and then the compositor passes it to the appropriate program once registered. This is already a thing in KDE Plasma 6 and works just fine.

[−] mikkupikku 62d ago
If Wayland doesn't get this solved then I'll just use X11 forever, with coding agents to keep it running if I have to.
[−] jauntywundrkind 62d ago
super interested to hear more on this.

i'm a little thrown, because the Wayland diagram doesn't feel quite right. the compositor does lie between the kernel and the apps, but IIRC the apps have their own graphics buffers from the kernel that they are drawing into directly. the compositor then composites them together. to me, that feels more like the kernel is at the center of the diagram here: the wayland compositor is between the kernel and the output / input.

i don't think it has a huge impact on the discussion here. but this is such a key difference versus X, that i think is hugely under-told: Wayland compositors all rely on lots of kernel facilities to do the job, where-as X is basically it's own kernel, has origins where it effectively was the device driver for the gpu, talking to it over pci, and doing just about everything. when people contrast wayland versus X as wayland compositors needing to do so much, i can't help but chuckle, because it feels like the kernel does >50% of what X used to have to do itself; it's a much simpler world, using the kernel's built-in abstractions, rather than being multiple stacked layers of abstractions (kernels + X's own).

it means that the task of writing the display-server / compositor is much much much simpler. it's still hard! but the kernel is helping so much. there's an assumed base of having working GPU drivers!

author appears to super know their stuff. alas the FOSDEM video they link to is not loading for me. :(

one major question, since this is a protocol, how viable is it to decompose the window management tasks? rather than have a monolithic window manager, does this facilitate multiple different programs working together to run a desktop? not entirely sure the use case, but a more pluggable desktop would be interesting!

[−] SilentM68 62d ago
Insightful article. I don't recall ever viewing an easy-to-follow lesson, tutorial or book for that matter that clearly explained the various components of a Linux Desktop environment. Always had to follow complicated and obscure guides to do this and that, when solving issues, but seldom did any explain their functions clearly.
[−] lproven 60d ago
FWIW I wrote about this last month on El Reg:

https://www.theregister.com/2026/02/11/river_wayland_with_wm...

[−] imiric 62d ago
I'm very excited about river.

I switched to niri a few months ago, and while I like it for the most part, it feels too... busy for my taste. It defaults to a bunch of animations and decorations, all of which I've turned off. I'm happy with my current setup (aside from Wayland quirks[1]), but river's design and simplicity are very appealing. It reminds me of the philosophy of bspwm/sxhkd which I used for years on X11.

I do need scrollable tiling now that I've tried it, and I'm happy that there are a couple of options to choose from with river.

[1]: Seriously, why does copy/pasting sometimes simply not work?? I often have to copy twice for it to succeed. It's not related to Xwayland -> Wayland apps, and viceversa, or with copying from closed windows, etc. I don't use nor want a clipboard "manager". I just want my clipboard to work consistently. I've read many reports of this same bug on different distros and DEs, and nobody has figured it out. It's infuriating that such a basic feature is half-broken in a project that is 17 years old now!

[−] trekkie99 61d ago
Really like River. Written in zig btw, which is something to potentially consider given the language’s adolescence. By default river ships with rivertile as its wm which is quite limited (no monocle layout or per tag configuration). Rivercarro is a fork of rivertile that adds these settings and others so I’d recommend starting there. I also just really enjoy doing all the configuring by default with a shell script.
[−] inatreecrown2 62d ago
Loving the Canoe window manager concept/screenshot. I long for such a simple UI and will try out river on my thinkpad.
[−] sourcegrift 62d ago
At this point, take all the lessons of wayland, plan everything in advance rather than incrementally deciding basic things like screenshotting and then build something new, superseding wayland so that power users like me and app developers will stop clinging to X. Right now I have no confidence in wayland and I know I'm not alone.
[−] phendrenad2 62d ago
I'm currently using an old window manager that I dug out of the depths of history. 1.0 was released in 1985. 2.0 shortly after. 3.0 a few years later. But version 3.1 was when things really got good. It's been great ever since.