I started working on Flyaway with the intention of becoming familiar with Wayland, its protocols and extensions, and the wlroots library. Instead, I ended up genuinely liking all three.

This is Budgie "running" "in" Flyaway. Blame Joey Riches for this one.

Wayland is an interesting beast. X11, for all its faults, does a lot for the desktop environment. If you’re stretched for time, you could - in theory - just slap a panel onto the default X11 window manager and call it a day. The modern landscape of desktop environments built on top of X11 exists because developers have gotten really good at eschewing X11’s built-in crusty junk for their own new and shiny junk, so that things work as you’d expect them to. For the most part, this kinda works - with enough hacks, you can get things like variable refresh rate, fractional scaling, et cetera.

The problem here is that X11 definitely was not built for those things. Variable refresh rate works, but only if you’re using a single monitor, and mixed refresh rate monitors in a single X session don’t work at all outside of the hardware cursor. Fractional scaling is a hack. Compositing in general is optional and is sort of just stapled onto the existing architecture. X11 does do what it needs to do, which is display windows, but it’s kinda garbo when you need it to do anything more advanced.

Wayland is what happens when issues with the dominant windowing protocol have been festering for decades. It throws away everything and establishes a core set of standards that must be adhered to, along with a (very large) set of extensions that can be optionally implemented. The website wayland.app shows all the protocols worth knowing, and a lot more on top of that. It’s kinda like Vulkan, in a sense: the core has the basics, and everything else is extensions that can be queried for by clients.

Wlroots is a library that writes all the code that I didn’t want to have to write, because it has too much math. It’s a generally unopinionated framework for building your own Wayland compositor that, while not perfect, does most of the heavy lifting for you. In writing Flyaway, most of the work so far has been figuring out how to put together the pieces that wlroots has given me; piping and such. Sadly, the documentation kinda sucks, but examples are plenty (e.g. sway and clay) and the developers have been very accessible and helpful when I’ve had questions.

Right now, I’m focused on implementing the XDG shell protocol that has all the desktop windowing functionality you expect, like maximizing/minimizing/tiling, and the wlroots-spearheaded wlr-layer-shell protocol for KDE/Budgie style panels and docks. The former is a must-have, and the latter is what I have determined is the best way for Budgie’s panel system to be ported to Wayland. The below is a small demonstration of what I’ve accomplished so far with wlr-layer-shell, using the gtk-layer-shell example binary.

Primarily, what I’ve learned is that Wayland is actually really well-designed. The writing is on the wall for X, and Wayland really is the future. I look forward to the day when I will be able to start up a Budgie desktop shell and have Wayland be running underneath. Oh, and it’ll have proper VRR support, or I’m not signing off on it.