TheDocumentation 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-protocols-wlr crate provides pre-generated Rust bindings for the wlr-protocols repository — a collection of Wayland protocol extensions created by and for the wlroots compositor library. These protocols are widely implemented beyond wlroots itself; compositors such as Sway, Hyprland, and River support them, making them the practical standard for many advanced desktop shell features.
Unlike the official wayland-protocols repository, wlr-protocols does not use a formal stability tier system. All interfaces carry the zwlr_ prefix (the z indicating they originated as “unstable” in the broader ecosystem). In practice, many of these protocols are extremely stable and used in production by a large number of projects.
Cargo setup
Addwayland-protocols-wlr to your Cargo.toml and select the client feature, the server feature, or both. The crate automatically enables the corresponding wayland-protocols feature for any protocols that depend on XDG Shell.
Available protocols
Each protocol is a top-level module in the crate. Theclient and server sub-modules within each are gated behind the respective Cargo features, exactly as in wayland-client and wayland-server.
Layer Shell — layer_shell::v1
zwlr_layer_shell_v1 is arguably the most widely used wlr protocol. It allows a privileged client to place surfaces in one of four ordered layers (background, bottom, top, overlay) that sit above or below normal application windows. This is the standard mechanism for desktop shells, wallpaper renderers, notification daemons, and on-screen keyboards to position their surfaces.
xdg-shell for popup support; wayland-protocols-wlr handles this transitive dependency automatically.
Screencopy — screencopy::v1
zwlr_screencopy_manager_v1 allows clients to request that the compositor copy a region of screen content into a client-provided wl_buffer. This is the standard mechanism for screenshot tools, screen recorders, and remote desktop applications on wlroots-based compositors.
Data Control — data_control::v1
zwlr_data_control_manager_v1 gives privileged clients the ability to read and set the clipboard selection and primary selection, independently of keyboard focus. Clipboard managers are the primary consumer of this protocol.
Output Power Management — output_power_management::v1
zwlr_output_power_manager_v1 allows clients to control DPMS-like power states for individual outputs — turning them on, off, or into a standby mode. Desktop shells use this to implement idle-triggered screen blanking.
Output Management — output_management::v1
zwlr_output_manager_v1 exposes the full set of compositor output configuration properties — mode, position, transform, scale — and allows clients to atomically apply a new configuration. Display configuration tools use this protocol.
Foreign Toplevel Management — foreign_toplevel::v1
zwlr_foreign_toplevel_manager_v1 enumerates all open application windows (toplevels) across all clients, and provides requests to activate, minimize, maximize, or close them. Taskbars and window switchers are the primary consumers.
Gamma Control — gamma_control::v1
zwlr_gamma_control_manager_v1 allows a privileged client to set the gamma lookup table for an output. Color temperature adjustment tools (e.g. blue-light filters) use this.
Export DMA-BUF — export_dmabuf::v1
zwlr_export_dmabuf_manager_v1 provides low-overhead screen capture by exporting output or surface content as DMA-BUF file descriptors, avoiding a CPU copy.
Input Inhibitor — input_inhibitor::v1
zwlr_input_inhibit_manager_v1 prevents any other client from receiving input events for the duration the inhibitor is held. Used by lock-screen implementations.
Virtual Pointer — virtual_pointer::v1
zwlr_virtual_pointer_manager_v1 lets clients synthesise pointer events, enabling remote desktop servers and accessibility tools to inject mouse input.
Usage example: layer-shell client
The following example shows the minimal wiring needed to bindzwlr_layer_shell_v1 from the registry and create a surface anchored to the top of the screen — the basis for a status bar or notification area.
zwlr_layer_surface_v1 follows the same configure/ack_configure handshake as xdg_surface. The compositor sends a configure event with the allocated width and height; the client must call ack_configure(serial) and then commit a buffer of the negotiated size before any content is shown.