The core Wayland protocol defines a handful of primitives — surfaces, outputs, seats, and buffers — but nearly everything that a real desktop application or compositor needs lives in protocol extensions. These are additional XML specifications that define supplementary globals and interfaces: window management, screen capture, fractional scaling, color management, clipboard control, and much more. wayland-rs ships a family of crates that provide pre-generated, type-safe Rust bindings for these extensions. Rather than runningDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/smithay/wayland-rs/llms.txt
Use this file to discover all available pages before exploring further.
wayland-scanner yourself, you add the appropriate crate as a dependency, opt into the features you need, and the client-side or server-side types are ready to use. Every protocol module exposes a client sub-module (gated by the client feature) and a server sub-module (gated by the server feature), matching the same pattern used in wayland-client and wayland-server.
Protocol crates
wayland-protocols
The official extensions from the wayland-protocols repository. Contains stable, staging, and unstable tiers covering XDG shell, viewporter, presentation-time, Linux DMA-BUF, fractional scale, and more.
wayland-protocols-wlr
Bindings for the wlr-protocols repository maintained by the wlroots project. Includes layer-shell, screencopy, output management, and gamma control.
wayland-protocols-plasma
Bindings for plasma-wayland-protocols, the KDE project’s collection of Plasma-specific extensions such as blur, shadow, DPMS, and screencast.
wayland-protocols-misc
Orphaned or de-facto protocols with no official home — GTK primary selection, virtual keyboard, and input method v2 — that are still widely used in the ecosystem.
wayland-protocols-experimental
Protocols under official evaluation that are not yet recommended for production use: experimental session management, input method, and text input extensions.
Custom protocols
Use
wayland-scanner proc-macros to generate bindings from any Wayland XML specification file.Adding a protocol crate to your project
Each crate follows the same convention. Add it toCargo.toml and select at least one of the client or server features. You typically want wayland-client or wayland-server as a direct dependency too, because the generated types reference their traits.
Protocol stability tiers
Thewayland-protocols crate organises its contents into three tiers that reflect how mature a protocol specification is. Understanding the differences matters when deciding which protocols to rely on in production code.
- Stable
- Staging
- Unstable
Stable protocols have gone through the full wayland-protocols review process and are considered production-ready. Their interfaces will not change in a backward-incompatible way. Examples include
xdg-shell, linux-dmabuf, viewporter, presentation-time, and tablet-v2. These are available unconditionally — no Cargo feature flag is required.You can combine feature flags freely. A compositor that needs staging session-lock and legacy unstable pointer-constraints can use
features = ["server", "staging", "unstable"] in a single dependency declaration.Module layout inside each crate
Withinwayland-protocols, protocols are grouped into four top-level modules:
| Module | Purpose |
|---|---|
wayland_protocols::xdg | Window management protocols (XDG Shell, XDG Output, XDG Decoration, etc.) |
wayland_protocols::wp | General-purpose protocols (presentation-time, viewporter, linux-dmabuf, tablet, etc.) |
wayland_protocols::ext | Miscellaneous protocols that don’t fit the other categories (idle-notify, session-lock, etc.) |
wayland_protocols::xwayland | Protocols specifically for the XWayland compatibility layer |
client and server sub-modules that are conditionally compiled based on the active Cargo features: