Comparison of X.org and Wayland

X.org and Wayland are display servers used on Linux and other operating systems for graphical user interface. A display server is the key component of graphical interface, and is responsible for managing input/output operations for graphical software.

The most commonly used display server on Linux is X.org, which implements X11 protocol. X11 window system consists of X11 server (X.org), X window manager and graphical software. X11 protocol is very old, complex, and was made specifically for the purpose of being used through a network, where graphical interface is rendered on a separate computer.

X11 protocol has various flaws, such as excessive complexity, lack of good isolation between X11 clients, and need for multiple extensions. Due to these problems, a decision to make a new display server protocol was made, and that protocol is Wayland.

Unlike X.org, Wayland is only a protocol, rather than an actual display server. Under Wayland, each desktop environment has to provide its own implementation, which is called a Wayland compositor. A Wayland compositor is functioning as a display server and a window manager in a single package, and works in a rather simple way: graphical programs send their output to compositor, which combines them into a single image and puts it on the screen. Because of this, Wayland has better performance. In addition to that, Wayland has good isolation between clients, which makes it more secure.

While X11 clients can't run under Wayland, there is XWayland, an X11 server running as a Wayland client, that allows to run X11-only software under Wayland.

So, why don't we just use Wayland instead of X.org?

First, Wayland is only implemented in a few desktop environments: Gnome, KDE Plasma and Sway. Second, Wayland also requires GBM implementation in the GPU driver, which is only available on Intel and AMD graphics. Nvidia uses its own interface, EGLStreams, which only works with Wayland implementation in Gnome and Plasma.

In addition to that, some X.org features, such as screen recording, are still lacking from Wayland.


Available as video here


2021/02/06