What Is Wayland? Linux Display Protocol Explained
In this article
Wayland is a display server protocol for Linux and other Unix-like systems that defines how applications communicate with the system's graphics hardware. It is designed to replace the older X11 (X Window System) protocol, offering a simpler, more secure, and more efficient way to render graphical interfaces. In practical terms, Wayland is the layer that lets your desktop environment (like GNOME or KDE Plasma) draw windows, handle mouse input, and display video. Most modern Linux distributions now offer Wayland as the default session, though X11 remains available as a fallback.
Background: Why Wayland Was Created
X11 was developed in the 1980s and became the standard display system for Unix-like operating systems. Over decades, it accumulated a lot of legacy code and design decisions that made it insecure and inefficient. For example, X11 allows any application to read the input of other applications (keylogging) and to capture the entire screen without permission. It also relies on a separate compositor for visual effects, which adds latency and complexity.
Wayland was started in 2008 by Kristian Høgsberg, a Red Hat developer, as a cleaner replacement. The core idea is to combine the display server and the compositor into a single component called the Wayland compositor. This compositor directly manages windows, input, and output, eliminating the need for a separate window manager and compositing manager. The result is a leaner system with better security and smoother graphics.
How Wayland Works
In the X11 model, the X server is a central process that mediates between applications and the hardware. Every window draw request, input event, and screen update goes through the X server, which then forwards it to the hardware. This adds overhead and allows for security vulnerabilities.
Wayland flips that model. The compositor is the central authority. Each application (called a client) renders its own window content into a buffer, then hands that buffer to the compositor. The compositor then composites all the buffers into a single image and presents it to the display. Input events (mouse, keyboard, touch) go directly from the compositor to the focused client, without passing through other clients.
Key components of a Wayland system:
- Compositor: The display server and window manager in one. Examples: Mutter (GNOME), KWin (KDE), Sway (for tiling WMs).
- Protocol: The Wayland wire protocol that defines messages between clients and compositor.
- libwayland: The client and server libraries that implement the protocol.
- Weston: A reference compositor that serves as a testing and demonstration tool.
Wayland vs. X11: Key Differences
The most significant differences between Wayland and X11 are security, performance, and features.
- Security: Wayland isolates clients by default. A client cannot see other clients' input or screen content unless the compositor explicitly allows it (e.g., for screen sharing). X11 allows any client to read all input and capture the screen.
- Performance: Wayland eliminates the extra compositing step that X11 requires. The compositor directly presents the final frame, reducing latency and improving frame pacing.
- Simplicity: Wayland has a much smaller codebase and fewer moving parts, which makes it easier to maintain and debug.
- Network transparency: X11 supported running applications on a remote machine and displaying them locally. Wayland does not support this natively; you need extra tools like Xwayland or a VNC/RDP solution.
- Compatibility: X11 has been around for decades, so many older applications and graphics drivers are built for it. Wayland can run X11 applications through a compatibility layer called Xwayland, but some features like screen recording and global hotkeys may not work perfectly.
How to Choose: Wayland or X11?
Most users should choose Wayland if their distribution offers it as the default, because it is more secure and modern. However, there are scenarios where X11 is still the better choice:
- You rely on legacy X11-only features: Some applications (e.g., certain screen-sharing tools, remote desktop servers, or window managers like i3) do not fully support Wayland yet.
- You need network transparency: If you regularly run remote X11 applications over SSH, X11 is easier.
- You use an NVIDIA GPU with older drivers: While modern NVIDIA drivers support Wayland well, older drivers may have issues with hardware acceleration under Wayland.
- You use a tiling window manager that is not Wayland-native: Tiling WMs like i3 and bspwm are X11-only; you would need a Wayland-native alternative like Sway.
To switch between Wayland and X11 on most distributions, log out and choose the session type from the login screen (e.g., GDM or SDDM). The option is usually labeled "GNOME on Wayland" or "GNOME on Xorg."
Common Problems and Solutions
Wayland has matured significantly, but users still encounter a few recurring issues. Here are the most common and how to fix them:
- Screen sharing not working in video calls: Many apps (like Zoom or older versions of Discord) rely on X11 screen capture. Use the browser version or enable the PipeWire portal in your compositor's settings.
- Global hotkeys (e.g., volume keys) not working: Wayland restricts global shortcuts for security. Configure them in your compositor's settings instead of the application.
- NVIDIA GPU flickering or poor performance: Ensure you are using the latest NVIDIA driver and that your compositor has explicit sync support (most do now). If issues persist, switch to X11 temporarily.
- Applications using Java or older toolkits look blurry or scale incorrectly: Run them under Xwayland by forcing the app to launch with the
GDK_BACKEND=x11environment variable.
If That Did Not Work: Fallback to X11
If you cannot resolve a Wayland-specific issue, the simplest fallback is to log out and select an X11 session from the login screen. This is not a defeat; it is a pragmatic choice. X11 is still fully supported by most distributions and will remain so for years. The transition to Wayland is gradual, and some workflows simply need X11.
Frequently Asked Questions
Is Wayland faster than X11?
Generally, yes. Wayland reduces latency by eliminating the extra compositing step and allowing direct buffer sharing. However, the difference is often small for everyday tasks; you may notice it more in gaming or video playback.
Can Wayland run all X11 applications?
Most X11 applications run through Xwayland, a compatibility layer that runs inside a Wayland compositor. Some apps that rely on low-level X11 features (like screen capture or global hotkeys) may not work perfectly, but the vast majority work fine.
Does Wayland work with NVIDIA graphics cards?
Yes, modern NVIDIA drivers (version 470 and newer) support Wayland with proper hardware acceleration. Older drivers may have issues, but the current stable drivers work well.
How do I check if I'm running Wayland or X11?
Open a terminal and run echo $XDG_SESSION_TYPE. It will print wayland or x11. Alternatively, run loginctl show-session $(loginctl) -p Type.
Is Wayland secure?
Wayland is significantly more secure than X11 because it isolates clients and does not allow arbitrary input capture or screen reading. However, no system is perfect; a compromised compositor could still cause issues, but the attack surface is smaller.
Will X11 ever be removed from Linux?
Eventually, yes, but not soon. Major distributions have stated they will keep X11 available for a long time to support legacy applications. The goal is to make Wayland feature-complete so that X11 becomes unnecessary, but that is a slow process.