Generated by GPT-5-mini| Layer Shell | |
|---|---|
| Name | Layer Shell |
| Type | Shell protocol |
| Introduced | 2018 |
| Developer | Swaywm Project |
| License | MIT License |
Layer Shell
Layer Shell is a compositor protocol extension for Wayland compositors that enables desktop-style surfaces such as panels, notifications, and lockscreens to be placed in reserved display layers. It originated in the context of Sway (window manager), Wayland (display server protocol), and wlroots development, and has been adopted by multiple projects in the Linux graphical stack. Developers use it to implement persistent UI elements for environments like GNOME, KDE, and lightweight desktops such as i3 and Enlightenment.
Layer Shell provides a mechanism to create anchored, exclusive, and stacked surfaces that exist outside the normal window stacking order used by clients like Firefox, Chromium, and LibreOffice. It complements the Wayland protocol core by defining roles for desktop components familiar from X Window System-based desktops such as panels found in GNOME Shell, taskbars used by KDE Plasma, and notifications like those in Mutter. The specification addresses interactions with input focus managed by compositors such as weston and sway, and harmonizes behavior with input methods like IBus and Fcitx.
The design separates layer management from client surfaces by introducing explicit layer roles (e.g., background, bottom, top, overlay) akin to layering schemes in CSS and window types in X11. Compositors implement this via protocols in wlroots or direct patches to compositors such as Wayfire, Weston, and Sway (window manager), coordinating with subsystems like libseat and logind. Anchoring and exclusive zone concepts interact with display metrics from DRM and output configuration handled by KMS drivers and utilities like xrandr-equivalents for Wayland. The architecture ensures that panels and docks can reserve space, enabling tiling clients such as i3, bspwm, and awesome (window manager) to avoid occlusion.
The protocol defines requests and events for creating layer surfaces, setting anchors, margins, and exclusive zones; implementations exist in libraries such as wlroots and compositors including Sway (window manager), Wayfire, and Weston. Bindings and client libraries appear in toolkits and projects like GTK+, Qt, EFL, and higher-level toolkits used by GNOME and KDE Plasma developers. Implementations interact with compositor protocols like xdg-shell and integrate with session managers such as systemd-logind and display servers like Wayland (display server protocol). Testing and reference implementations draw on examples from GitHub, GitLab, and continuous integration practices used by Debian, Fedora, and Arch Linux packagers.
Layer Shell is used to implement status bars, docks, panel widgets, on-screen keyboards, and lockscreens in projects such as Sway (window manager), Wayfire, and desktop environments like GNOME-based extensions or KDE Plasma widgets. It supports system-level overlays for applications like Steam, OBS Studio, and voice assistants in commercial integrations reminiscent of UI overlays in Android and iOS ecosystems. Lightweight distributions and desktop shells leveraged by projects such as Alpine Linux, Ubuntu, and Fedora incorporate Layer Shell-enabled components for kiosk mode, digital signage, and embedded devices similar to solutions by Raspberry Pi Foundation and Canonical.
Because Layer Shell surfaces can reserve screen space and appear above normal applications, compositors must enforce permissions and focus policies to prevent spoofing attacks observed historically in X Window System-era attacks and mitigations like those in Wayland (display server protocol). Compositors integrate authentication and session controls from systemd and logind to manage privileged actions such as lockscreen access like implementations in GNOME Shell and KDE Plasma. Sandbox-oriented platforms exemplified by Flatpak, Snapcraft, and container runtimes like Docker influence how clients obtain access to display resources, while mitigations developed by Red Hat and security teams at Canonical guide best practices.
Layer Shell contrasts with legacy approaches from X Window System conventions like _NET_WM_LAYER and window types used by KDE and GNOME, and it complements newer Wayland protocols such as xdg-shell and zwp_tablet_manager_v2. Compared to compositor-specific extensions in Weston or proprietary overlays used by NVIDIA and AMD drivers, Layer Shell offers a standardized approach adopted across projects like wlroots-based compositors and independent implementations seen in Enlightenment and Sway (window manager). Its role is analogous to Android’s WindowManager layers used by Google and iOS overlays devised by Apple, but tailored to the modular, permission-focused architecture of the Wayland ecosystem.
Category:Wayland protocols