XWayland is a complete X11 server that runs as a client of a Wayland compositor, so applications written for the X Window System can keep working on a Linux desktop whose display stack is built on Wayland. It translates X11 windows into Wayland surfaces and forwards keyboard, pointer and touch input back to X clients, which makes it the main compatibility bridge between the two protocols.
Because thousands of programs, games and toolkits were written against X11 over several decades, no major Wayland desktop on Linux ships without XWayland support. GNOME, KDE Plasma, Sway and Hyprland all start it either at login or on demand when the first X client connects, and most users never notice which of their windows are native and which are bridged.
How XWayland bridges X11 clients to a compositor
XWayland works by embedding the X.Org server code in a process that, instead of driving the display hardware directly, draws into Wayland buffers. Each top-level X11 window becomes a Wayland surface, and the compositor places, scales and decorates that surface like any native window. The X server still speaks the full X11 protocol to its clients, so applications see an ordinary display such as :0 or :1.
A separate component, the X window manager inside the compositor, handles the X11 side of window management. Compositors such as Mutter, KWin and wlroots-based projects implement an internal X window manager that reads X properties such as WM_CLASS, _NET_WM_NAME and size hints, and then maps them to the compositor’s own window model. This pairing, often described as rootless mode, means that X windows appear individually rather than inside one large root window.
The following table lists the main components involved when an X11 program runs on a Wayland session.
| Component | Role | Protocol spoken |
|---|---|---|
| X11 client | Legacy application that draws windows | X11 via Unix socket |
| XWayland server | Receives X requests and renders into buffers | X11 and Wayland |
| Compositor | Composes all surfaces and routes input | Wayland |
| Internal X window manager | Translates X window hints into compositor state | X11 (ICCCM, EWMH) |
| Kernel graphics stack | Provides DRM, GBM and direct rendering | DRM and KMS ioctls |
For accelerated rendering, XWayland uses Glamor, an OpenGL-based acceleration layer, together with DRI3 and buffer sharing through dma-buf. An X application that renders with OpenGL or Vulkan therefore writes into GPU memory that the compositor can import directly, avoiding a costly copy. On NVIDIA hardware, full acceleration depends on driver support for GBM and explicit synchronization, which matured only in recent driver generations.
Startup modes and configuration
XWayland can be started in several ways, and the choice affects memory use, login time and reliability. Older desktops launched it unconditionally at session start, while current releases prefer lazy activation, in which the compositor listens on the X socket and launches the server only when a client connects.
| Mode | How it starts | Typical use |
|---|---|---|
| Always on | Started together with the session | Older GNOME and KDE Plasma releases |
| On demand | Started at the first X connection | Current GNOME, Sway and Hyprland |
| Disabled | Never started, X sockets absent | Pure Wayland kiosks and test setups |
| Rootful | Runs one full X desktop in a window | Nested X sessions and legacy window managers |
In wlroots compositors, the xwayland option in the configuration file enables, disables or forces the server; GNOME exposes similar behavior through Mutter experimental features. Administrators who disable XWayland entirely gain a slightly smaller attack surface, but any program that still requires X11 will then fail to open a display.
XWayland compared with native Wayland and a full X server
XWayland sits between a traditional X11 session and a pure Wayland client, and its behavior inherits constraints from both worlds. The comparison below shows where an X application running through the bridge differs from the alternatives.
| Aspect | Native Wayland client | X11 client on XWayland | X11 client on X.Org |
|---|---|---|---|
| Input isolation | Strict per-client isolation | X clients can observe each other | No isolation between clients |
| Fractional scaling | Sharp at any scale | Often blurry when upscaled | Handled by toolkit or not at all |
| Screen capture | Through portals and PipeWire | Only other X windows directly | Whole screen freely readable |
| Global hotkeys | Through portals or compositor | Only while an X window has focus | Unrestricted key grabs |
| Tearing control | Tearing-control protocol | Follows compositor policy | Driver and compositor dependent |
The security point deserves attention. Inside XWayland, X clients can still read each other’s keystrokes and window contents, because the X11 protocol has no notion of isolation. However, they cannot see native Wayland windows, so a password manager running natively remains protected from a keylogger running as an X client.
Scaling, input and other practical limitations
The most visible limitation is HiDPI and fractional scaling. X11 has a single global coordinate space and no per-window scale factor, so the compositor usually renders X windows at scale 1 and then upscales the bitmap, which produces blurry text at 125 or 150 percent. Recent compositors offer an option to let XWayland windows render at native resolution, but then applications must apply their own scaling through toolkit settings or Xft.dpi.
Input is a second source of friction. Pointer warping, absolute cursor positioning and exclusive grabs, which many games and remote-desktop clients rely on, are emulated through Wayland pointer-constraints and relative-pointer protocols. The emulation works well in most titles, yet edge cases such as mouse lock in older engines can misbehave.
The next table maps common symptoms to their usual cause and remedy.
| Symptom | Likely cause | Usual remedy |
|---|---|---|
| Blurry application text | Bitmap upscaling of X windows | Enable native XWayland scaling and set toolkit DPI |
| Screen sharing shows black | X tool cannot capture Wayland output | Use a portal-aware capture application |
| Hotkeys work only in focus | No global key grabs across protocols | Bind shortcuts in the compositor |
| Flicker on NVIDIA | Missing explicit synchronization | Update driver, XWayland and compositor |
| Clipboard loses content | Owner process exits before transfer | Run a clipboard manager |
Clipboard and drag-and-drop between X and Wayland windows are proxied by the compositor, which translates X selections into Wayland data offers. This usually works transparently, although large transfers or unusual MIME types occasionally fail.
Identifying and reducing XWayland usage
Knowing which windows run through XWayland helps when diagnosing scaling or capture issues. The xlsclients command lists connected X clients, and tools such as xeyes only follow the cursor over X windows, which gives a quick visual test. KDE Plasma offers a window property inspector, and Hyprland reports an xwayland flag for every client.
Many applications can switch to native Wayland with a toolkit setting. GTK and Qt programs generally choose Wayland automatically, while Electron and Chromium applications need --ozone-platform-hint=auto or an equivalent flag, and Firefox uses MOZ_ENABLE_WAYLAND=1 on older releases. Java Swing, Wine and many games still depend on X11, so XWayland remains necessary for the foreseeable future; Wine has a native Wayland driver under active development but not yet universal.
A non-technical view
Linux desktops are moving from an old display system, X11, to a newer one called Wayland. Many older programs only know how to talk to the old system. XWayland is a translator that sits in the middle: it pretends to be the old system for those programs and passes their windows on to the new one.
Think of it as a travel adapter for a plug from another country. The device works as usual, but small differences can show, such as slightly blurry text on high-resolution screens. The key takeaway is simple: XWayland is why old applications still open on a modern Linux desktop.
A concrete example
A developer uses a laptop with a 14-inch 2880 x 1800 display running a Wayland session at 175 percent scaling. Native GTK and Qt programs look sharp, but an older Java-based database tool and a chat client built on Electron both appear noticeably fuzzy. Running xlsclients shows that both are connected through XWayland.
For the chat client, the developer adds --ozone-platform-hint=auto to its launcher, and it switches to native Wayland with crisp text. The Java tool has no Wayland backend, so the developer enables the compositor option that lets XWayland windows render unscaled and sets the toolkit scaling factor to 1.75. The result is sharp text in both applications, with the Java tool still running through XWayland but no longer blurred.