Kelly Mears

Display Server

The program that sits between applications and the screen, keyboard, and mouse, deciding what is drawn where and who receives input. On Linux it is moving from X11 to Wayland.

Systems & Tooling2 min read376 words13 out · 8 in
also calledWaylandX11X Window SystemXorgXWaylandDesktop portal

A display server sits between applications and the display and input hardware. Applications ask it for windows and draw into them. The display server decides where windows appear, assembles the screen, and routes keyboard and mouse input to the right application. On Linux and other Unix-like systems, two designs dominate: the X Window System (X11) and its successor, Wayland.

X11 dates to 1987 and was designed for a world of network terminals. Its protocol lets an application on one machine draw on another machine's screen. The naming confuses newcomers: the server runs on the machine with the screen, and applications are its clients. Over decades X grew extensions for everything it lacked, until most modern drawing bypassed its core entirely. Its security model also belongs to another era. Any X client can read every keystroke and capture any window, so one malicious or compromised application can watch the whole session.

Wayland, started in 2008 by Kristian Høgsberg, is a protocol rather than a single program. Each desktop implements its own Compositor, which is also the display server and the window manager. Applications render their own windows and hand finished buffers to the compositor. Clients are isolated from one another by default: an application cannot see other windows or listen to keys sent elsewhere. That follows Least Privilege, but it broke screen sharing, global hotkeys, and color pickers, which all relied on X's openness. The answer is desktop portals, a permission-mediated D-Bus interface through which an application asks the user, via the compositor, for a screen capture stream (delivered over PipeWire) or a file.

The transition took more than a decade, a case of Path Dependence and of the Network Effect around a protocol everything already spoke. Two mechanisms made it possible:

  • XWayland runs a small X server inside a Wayland session, so legacy applications keep working. It is an API Translation Layer in the same family as those that run Windows games on Linux.
  • Protocol extensions let compositors add features beyond the small core protocol. The price is fragmentation: a feature may exist in one compositor and not another.

Each design choice made one set of problems hard and a different set easy, a pattern also seen in Init System and Package Manager transitions.

See also6

Graphics Driver

The software that translates a program's drawing commands into instructions a particular graphics card can execute, split between a kernel part that manages memory and displays and a large user-space part that compiles shaders and implements graphics interfaces.

Systems & Tooling17 connections

Clipboard

The shared buffer behind cut, copy, and paste, invented at Xerox PARC, which offers data in several formats at once and has become a channel for snooping and for commands that paste differently from how they looked.

Systems & Tooling14 connections

Inter-Process Communication

The channels separate processes use to exchange data and signals, from pipes and sockets to shared memory, a necessity because each process is walled off in its own memory and a frequent route for sandbox escapes.

Systems & Tooling13 connections

Tiling Window Manager

A window manager that arranges windows automatically into non-overlapping tiles and is driven mainly from the keyboard, trading freeform placement for zero layout effort.

Design & Interface11 connections

Remote Desktop

Controlling a computer from somewhere else by streaming its screen to a distant machine and sending keyboard and mouse input back, used for IT support, remote work and cloud gaming, and a favorite entry point for attackers when left exposed.

Networks & Distribution9 connections

Input Method

The software layer that turns keystrokes into text for writing systems with far more characters than a keyboard has keys, such as Chinese, Japanese and Korean, by letting people type sounds or shapes and choose from candidates.

Systems & Tooling8 connections

Linked from8