State of wayland in 2022
I have written about wayland before and how I try to make the switch about once a year and then quickly give up and move back to X11. Currently I am doing another test run and thought that I could turn this into a series: Every time I try out wayland, I will write a blog post about what improved and what still doesn’t work.
My current test run is still running, so if I am lucky this is both the first and final entry in that series. But, as you will see, there is still a lot of potential for frustration.
Please do not read this as a criticism of wayland as a whole. I understand that my use case may not be super common. These are just my personal notes on how well wayland works for me.
My OS is Debian Bookworm, so all software is in the version that is included with that OS.
I basically use the same setup I described in 2020 where sway acts as a generic display server and an IPC client does the actual window management.
I am not yet fully decided on sway-bar vs waybar, but for now I am using sway-bar with a custom status script. In addition there are several smaller tools that are somewhat needed for a complete desktop: swayidle, swaylock, grim, slurp, wl-clipboard, and xdg-desktop-portal-wlr.
Last time I had major issues with blurry fonts because I did not manage to configure antialiasing correctly. This time around,
gsettings set org.gnome.desktop.interface font-antialiasing 'rgba'seems to have done the job. I am not sure if anything changed here or if I just missed the correct option before.
Redshift on Debian is patched to support wayland, so no issues there.
wdisplays is a nice alternative to arandr to manage multiple displays.
Copying text via primary selection just works!
Screen sharing in Firefox. Pipewire is mostly usable now (I still sometimes get noise on my microphone that goes away with a reboot). xdg-desktop-portal-wlr needs some weird incantations, but they are described well in the README.
Both sway-bar and waybar can be used as status notifier hosts (trays). sway-bar doesn’t implement dbusmenu, but I prefer to use my rofi SNI script for that anyway.
There are very few applications on my system that still use gtk2. The big one is gimp, and that is the reason why gtk2 will stay for a while. But other than that the migration to gtk3 seems to be completed. So lets start porting everything to gtk4 now!
What needs more work?
GUI applications that run as root, such as gparted or synaptic, fail to start. AFAIU, this is expected because of the stricter security model in wayland. I guess these applications have to be rewritten to run as a regular user and talk to some system service like packagekit.
Sway cannot be launched from lightdm
Firefox still uses X11 by default. Wayland can be enabled using
MOZ_ENABLE_WAYLAND=1. As far as I can tell, everything works, but some details are ever so slightly off. For example, the spinner in a loading tab is replacedby a static hourglass icon. And when I drag and drop text it is drawn in the wrong position, as if I had grabbed it in the very corner. These are details, but for some reason they annoy me deeply.
The choice of compositors is still very limited. Outside of the big desktop environments, sway is still the only real competitor. There are plenty of other projects, but as far as I can tell they are all either unfinished or abandoned. There especially seems to be a lack of stacking compositors in the spirit to openbox.
There is still no usable task bar. Waybar provides a task bar based on the foreign toplevel manager protocol. Unfortunately, this protocol does not have a concept of workspaces, so it is basically useless for me.
Focus is not automatically given to a different window when I expect it. For example, if I click a link in an email, I want to switch focus to the browser. Sway has the setting
focus_on_window_activationfor X11 clients and the xdg-activation protocol for wayland clients, but neither really works for me.
The above mentioned xdg-activation protocol is a good example of my next issue: I find it hard to understand the protocol documents. On the one hand I would prefer a more compact representation of the interface, e.g. in some pseudo code. On the other hand, I would like more verbosity and structure in the prose, especially providing some motivation, rationale, and security considerations. I think RFCs are a pretty good example of how to do this well.
The biggest headache is the touchpad. There are several issues with it:
Two finger detection doesn’t really work reliably. My computer regularly performs a single click (one finger) when I intended to do a middle click (two fingers).
There seems to be a high threshold for movement. This makes it incredibly hard to make small and exact movements, e.g. to click on a small link.
Kinetic scrolling doesn’t stop when I tap the touchpad again. The fix is already implemented in libinput and gtk4, but it will not be backported to gtk3.
So there you have it. 14 years after the initial wayland release we do have a usable desktop experience. Unfortunately, there are still gaping holes. Fortunately, there is an active community and things are constantly improving. I am excited to see what will have changed when I will do the next entry in this series.