wlroots
More info
- Creator
- Drew DeVault
- Released
- Type
- Library
- License
- MIT
- Source
- gitlab.freedesktop.org/wlroots/wlroots
The library that made writing a Wayland compositor a thousand-line job instead of a sixty-thousand-line one — built for Sway in 2017 and since then the foundation under most compositors not named Mutter or KWin.
Wayland is a protocol, and whoever builds a compositor has to write everything the X server used to do: talk to DRM/KMS, read input through libinput, render with OpenGL or Vulkan, implement xdg-shell and a dozen other protocols, and run XWayland for legacy clients. Drew DeVault started wlroots in 2017 when Sway outgrew the earlier wlc library, with a README line about "60,000 lines of code you were going to write anyway". The modules are loosely coupled on purpose: a compositor picks what it wants and keeps every decision about windows and focus to itself.
The library ships backends for DRM, libinput, nesting inside X11 or another Wayland session, and headless operation; three renderers; a scene graph (wlr_scene, 2021) that handles damage tracking and repainting; and tinywl, a sample compositor of roughly a thousand lines of C. Sway, river, labwc, Wayfire, Cage and dwl all sit on top of it; Hyprland did until 2024, when it switched to its own Aquamarine. Simon Ser took over as lead maintainer when DeVault stepped back, and the code moved to freedesktop.org's GitLab. The version number has never reached 1.0, and every 0.x release breaks the API — something the compositors have learned to live with.