Wayland display server protocol
Long and Short Routes
In X11, the kernel transmits a mouse click via the evdev driver [8]. The X server determines which window the event is intended for and sends it to the client responsible for the window. One problem with this approach is that the position of the window is controlled by the compositor and not by X itself. Because a mouse click can change elements in the window or open a new window, the client sends a request to render to the X server. The X server then forwards this request to the graphics driver, which delegates the rendering to the hardware. The X server then calculates the geometry and position of the area to be rendered and sends a report called a damage event to the compositor, which provides the information that something has changed in the window and that an area of the display must be redrawn. The commands for this redraw again have to go through the X server.
The X server carries around a lot of baggage, but it doesn't actually have much functionality that is still useful today. The X server is the middleman, and these days it just generates unnecessary steps between the application and the compositor and between the compositor and the graphics hardware.
In Wayland, the compositor is also the display server (Figure 5). The kernel hands over events directly to the compositor. Wayland allows the compositor to transmit events directly to the clients and then lets clients send back damage events directly to the compositor. For example, the compositor looks for which window the event is intended. Thanks to its scene graph [9], the compositor knows exactly which changes have already been made to the window (Figure 6).
The event is forwarded directly to the clients, and the clients calculate the rendering themselves and send feedback to the compositor, stating that the window has been updated. The compositor redraws the window and sends a system call (ioctl
) to the Kernel Mode Setting (KMS) [10] to request a pageflip. The clients can't take over the rendering themselves because of the Direct Rendering Infrastructure (DRI) [11], which allows common video buffer storage for the client and server. This means that the client can link to a rendering library (e.g., OpenGL, Vulkan, or the rendering engines Qt or Gtk+), which then writes directly in the shared buffer.
The only supposed disadvantage of Wayland compared with X11 is that X11 is network capable, whereas Wayland is not. However, with the Remote Desktop Protocol (RDP) or Virtual Network Computing (VNC), users today have options for sending desktops or individual GUI application via the network. An RDP or VNC server based directly on Wayland is also conceivable. For security reasons, however, much more focus is placed on one of X11's weaknesses: In the past, the X server corresponded directly with the hardware, so it traditionally ran with root privileges. Thanks to KMS, today the X server theoretically can run without root privileges, but this option is hardly ever used. Wayland, on the other hand, doesn't require root privileges because it communicates with the hardware via the kernel.
Wayland's State of Development
Wayland and its reference compositor Weston are now up to version 1.9. The protocol itself is considered quite mature and no longer receives new functions, so developers of compositors for KDE, Gnome, Enlightenment, Sailfish OS, Tizen, and others have time to finish and test their Wayland implementations. The Weston reference compositor [14], on the other hand, provides new experimental technologies and interfaces.
New features include atomic kernel mode switching [15], which promises a completely flicker-free view change. A library that can manage the input devices of various compositors and that aims to replace drivers such as evdev, synaptics, or wacom was already integrated with libinput in Weston 1.5 (Figure 7). Fedora has used libinput for managing input and output devices since version 22.

Fedora has offered experimental support for Wayland for more than a year. The Fedora Rawhide distribution takes that support one step further and, as of recently, supports Wayland by default. Users might need to edit the /etc/gdm/custom.conf
file to receive a conventional X.Org session. Because not everyone wants to test Rawhide, the Fedora developers promise to implement Wayland bug fixes quickly so that users remain fairly close to the current state of development when updating their system.
The Test Course
To test Wayland using a Live image of Fedora 23, the user needs to create a password after starting the Live medium to obtain the Wayland option. To do so, just click the down arrow in the top right corner of the desktop, select Live System User | Account Settings, and enter a password. Fedora places value on passwords that are as safe as possible and therefore makes you create secure passwords.
Once you've created a secure password, go to Live System User | Log Out, and you'll be taken to the login manager, where you can select the Wayland session by clicking the cogwheel to the left of Sign In (Figure 8). The next thing to do is import the latest updates. The quickest way to import updates is in a terminal using the
sudo dnf upgrade
command. If you want to check whether a Gnome Wayland session is running, you can use the
ls -l $XDG_RUNTIME_DIR/wayland-0
command. A socket will be displayed in /run/user/1000
if this command is successful.
« Previous 1 2 3 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Direct Download
Read full article as PDF:
Price $2.95
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Find SysAdmin Jobs
News
-
KDE Plasma 5.27 Beta is Ready for Testing
The latest beta iteration of the KDE Plasma desktop is now available and includes some important additions and fixes.
-
Netrunner OS 23 Is Now Available
The latest version of this Linux distribution is now based on Debian Bullseye and is ready for installation and finally hits the KDE 5.20 branch of the desktop.
-
New Linux Distribution Built for Gamers
With a Gnome desktop that offers different layouts and a custom kernel, PikaOS is a great option for gamers of all types.
-
System76 Beefs Up Popular Pangolin Laptop
The darling of open-source-powered laptops and desktops will soon drop a new AMD Ryzen 7-powered version of their popular Pangolin laptop.
-
Nobara Project Is a Modified Version of Fedora with User-Friendly Fixes
If you're looking for a version of Fedora that includes third-party and proprietary packages, look no further than the Nobara Project.
-
Gnome 44 Now Has a Release Date
Gnome 44 will be officially released on March 22, 2023.
-
Nitrux 2.6 Available with Kernel 6.1 and a Major Change
The developers of Nitrux have officially released version 2.6 of their Linux distribution with plenty of new features to excite users.
-
Vanilla OS Initial Release Is Now Available
A stock GNOME experience with on-demand immutability finally sees its first production release.
-
Critical Linux Vulnerability Found to Impact SMB Servers
A Linux vulnerability with a CVSS score of 10 has been found to affect SMB servers and can lead to remote code execution.
-
Linux Mint 21.1 Now Available with Plenty of Look and Feel Changes
Vera has arrived and although it is still using kernel 5.15, there are plenty of improvements sure to please everyone.