$ show cage-kiosk/cage
Cage is a Wayland kiosk compositor written in C. It launches a single full-screen application, managing inputs, outputs, and window decorations. The architecture is a monolithic compositor built on wlroots 0.20, with separate modules for seat management, output handling, view management, and shell protocol support (XDG shell and XWayland). The main entry point is `cage.c`, which initializes the Wayland display, backend, renderer, and protocol managers, then spawns the given application as a child process. The compositor runs a single application full-screen, supporting multiple monitors (extend or last mode), idle inhibition, virtual keyboard/pointer, and foreign toplevel management. It is a well-structured, professional-quality C codebase with clear separation of concerns, consistent error handling, and proper resource cleanup. The code is directly derived from the wlroots tinywl example and has been matured into a robust kiosk solution.
The LLM identified 2 files worth highlighting for reuse:
Implements the idle inhibit protocol (zwp_idle_inhibit_manager_v1). Tracks inhibitors via a linked list and toggles the idle notifier state. The module is self-contained, only depending on the server header and wlroots idle protocols. It demonstrates a clean, minimal implementation of a standard Wayland protocol extension that can be extracted and reused in other wlroots compositors.
Provides the generic view interface (cg_view_impl) and lifecycle management (map, unmap, destroy, focus). The view abstraction decouples compositor logic from shell-specific implementations (XDG, XWayland). This pattern allows easy addition of new view types. The view positioning logic (maximize/center) is reusable in any single-app compositor.