Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Architecture

Cupertino is a Wayland desktop with separate compositor, shell, applications and services. The ISO and installer ship NetworkManager and BlueZ for network and Bluetooth service. Settings, the control panel and the menu bar select those backends when Cupertino’s own daemons are absent. The in-tree daemons remain development implementations; replacing the shipped services requires feature parity, including enterprise Wi-Fi, VPN and captive-portal handling for networking.

What we own, speak and keep

ScopeExamples
OwnUserspace libraries and policy daemonsdevice discovery, input, seat handling, keymaps, network, Bluetooth and power daemons, notification and tray services
SpeakWire protocols, implemented in Rust without a C libraryWayland; the D-Bus interfaces apps call (notifications, status items, menus); kernel interfaces (DRM/KMS, evdev, netlink, nl80211, Bluetooth management sockets, sysfs)
KeepExternal, each behind one crate boundarythe kernel; Mesa GPU drivers; the D-Bus broker; Smithay for Wayland protocol handling; NetworkManager and BlueZ in the installed distribution; iwd when using cupertino-netd; PipeWire for application audio and screen-sharing streams

Processes

A crash in a shell component or process never takes the desktop down.

ProcessOwns
cupertino-servercompositing, window policy, input routing, cursor, materials (backdrop rendering), the menu bar layer and its auto-hide, window snapping, supervision of the shell host and the built-in processes
cupertino-shellthe shell host: the shell’s components, each on a thread of its own, a failed one restarted alone; today the on-screen displays (osd: volume, brightness and keyboard-backlight overlays, and the keyboard’s input-source switcher and accent picker), the banners and the notification list (notifications, org.freedesktop.Notifications, the list kept across a restart), the control panel (controlcenter, org.cupertino.ControlPanel1), the menu bar (menubar: status items and application menus, DBusMenu, StatusNotifierItem, GMenuModel), the launcher (launcher, org.cupertino.Launcher1: the search and launch panel, and the application browser), the session agent (agent, org.cupertino.SessionAgent1: the log out, restart, shut down and power-button panels, the power key, login items, reopened applications, low-battery notices and the session menu’s state), the items of the Desktop folder on the desktop (desktop), the dock (dock: the bar, the application switcher, the Force Quit dialog, hot corners and the gestures no transaction takes), the overview (overview: the windows in holes, the desktops band, its gesture-bound way in and out) the window manager (windowmanager: the stage and tiling policy, off by default, and the stage strip, whose thumbnails are holes) and the portal’s dialogs (dialogs, org.cupertino.Dialogs1: the file chooser, the file family’s open and save panel, and the app chooser)
cupertino-loginthe login screen and the lock screen (ext-session-lock), with org.cupertino.Login1 (Lock)
cupertino-sessiondthe root-owned half of login: the login screen’s socket, PAM in a worker per attempt, logind sessions and virtual terminals, fast user switching, power, auto login
cupertino-screenshotscreen, window and selection capture, toolbar, floating thumbnail; with --serve, started for the portal, the colour picker and the screen-sharing chooser (org.cupertino.Screenshot1)
cupertino-promptsthe session’s prompts, always running: the polkit authentication agent’s prompt, the keyring’s password prompt and the consent prompts for desktop control, screenshots and global shortcuts (org.cupertino.Prompts1)
cupertino-portalthe xdg-desktop-portal backend, with no interface of its own: screen sharing (its PipeWire streams), screenshots and colour picking (the choosing and picking in cupertino-screenshot), the person’s consent (asked through cupertino-prompts), the file chooser and the app chooser (the dialogs in the shell’s dialogs component), appearance settings
cupertino-controldesktop control for local agents: output-scoped observation, capture, pointer and keyboard runs, each with the person’s consent per app, and its MCP stdio bridge (--mcp)
cupertino-filesthe file manager
cupertino-settingsthe settings app
cupertino-audiodsession-bus-activated org.cupertino.Audio1: default audio devices, volume, mute and stereo balance
cupertino-netdlinks, Wi-Fi through iwd, DHCPv4, resolv.conf, org.cupertino.Network1, on the system bus
cupertino-btdadapters, discovery, pairing with a UI agent, key store, org.cupertino.Bluetooth1, on the system bus
cupertino-powerdbatteries, mains, display and keyboard backlight, lid; the org.freedesktop.UPower subset apps call and org.cupertino.Power1

In a user session the server starts the shell host with the components the shell section of /etc/cupertino/compositor.json names, and four built-in programs from their installed paths, each with its roles: portal, prompts, desktop-control (cupertino-control --serve) and login (cupertino-login). With the server these are the processes always running; cupertino-screenshot starts when it is asked for, and cupertino-audiod by bus activation at first use. On the login screen only cupertino-login --greeter starts. cupertino shell list shows every component and process.

Rendering

The server composites and draws its materials (backdrop blur, glass) on the GPU with OpenGL ES through Smithay’s GLES renderer; with no hardware renderer, Mesa’s software renderer draws instead (Displays and GPUs). CupertinoKit applications and shell processes draw their windows with the renderer of their class, repainting only the damage: Files windows, Settings, the dock and the launcher with the GPU renderer (cupertino-ui-render’s gpu module, over the thin GPU layer cupertino-gpu), handed to the server as dmabufs; the small, rarely repainted and must-draw surfaces on the CPU (cupertino-ui-render) in shared memory; other applications on the CPU until a window is large or busy. The CPU renderer is the standard the GPU renderer follows and its fallback. GPU rendering has the design, docs/architecture/rendering.md the rules every rendering change keeps, and docs/plans/gpu-rendering.md the steps and their checklist (#155).

Rules

  1. The server does only what a window server does. The server restarts a shell process that exits with failure, at most once per second.
  2. Standard protocols first: layer-shell, ext-foreign-toplevel-list, ext-session-lock, ext-idle-notify, ext-image-copy-capture, xdg-activation.
  3. A private protocol covers the gaps. The public cupertino_app_effects_v1 carries backdrop materials by recipe and glass backdrops joined per container (regular, clear, or the dimmer style of large floating panels; each told whether its face is dark or light when it is small enough to follow what lies behind it), backdrops of a subsurface drawn between it and the rest of its window, so content scrolls under a bar’s glass, the title bar style, the appearance, whether the session is locked and where a window’s menus are on the session bus; the public cupertino_layers_v1 lets a window hand the compositor its presentation and layers of its own surface (place, size, opacity, scale, glass, content blur) to animate on the compositor’s clock; the private cupertino_shell_v1, offered only to the shell processes the server starts, carries dock tile rectangles for the minimize effect, overview and workspace transforms driven by the dock, menu bar overrides and how light and how uneven the wallpaper is under the menu bar, application activation and grouping, gesture events, and session lock and appearance notifications. The public cupertino_semantics_v1 lets a Kit application publish the semantic tree of its own surfaces (roles, names, states, bounds and actions) for desktop control, and cupertino_scroll_v1 gives the scroll count of a series of flicks beside the pointer’s axis events; the private cupertino_control_v1 and cupertino_control_authority_v1 are offered only to the desktop controller and to the session agent that asks the person for consent.
  4. One settings store: cupertino-defaults. Files live in $XDG_CONFIG_HOME/cupertino/, each with its own environment override. Writes are atomic and change notification is an inotify watch coalesced until a burst is quiet.
  5. Privileges stay in the daemons. They authorise callers by D-Bus peer credentials plus “is this the active seat user”. There is no polkit. The session runs a polkit authentication agent for other software’s actions; no Cupertino daemon asks polkit. System daemons ship unit files; that is packaging, not a code dependency.
  6. IPC: Wayland between the server and the shell; D-Bus between the shell, apps and the daemons.

Crate layers

A crate’s layer is declared in its manifest ([package.metadata.cupertino] layer). The table, from the bottom, says which layers each layer may depend on, in normal, build and dev dependencies; every crate may also have testing crates as dev-dependencies, and only dev-dependencies point at a testing crate. The crates column is what each crate declares.

LayerCratesMay depend on
foundation (values, maths and data models with no I/O)cupertino-animation, cupertino-geometry, cupertino-keyboard, cupertino-menu-model, cupertino-themefoundation
graphics (the one definition of the drawing maths, and the GPU device)cupertino-gpu, cupertino-raster-mathfoundation, graphics
models (desktop policy as pure logic)cupertino-control-model, cupertino-displays, cupertino-effects, cupertino-input, cupertino-scene, cupertino-wmfoundation, models
system (user-space operating-system access)cupertino-apps, cupertino-assets, cupertino-defaults, cupertino-diagnostic-events, cupertino-icons, cupertino-peer, cupertino-radios, cupertino-trashfoundation, system
platform (kernel interfaces that more than one program needs)cupertino-devices, cupertino-seatfoundation, platform
protocol (wire schemas)cupertino-app-protocols, cupertino-login-ipc, cupertino-protocolsfoundation, protocol
transport (client connections without widgets)cupertino-shell-client, cupertino-wayland-clientfoundation, system, platform, protocol, transport
render (the compositor’s own drawing)cupertino-cursor, cupertino-glassfoundation, graphics, system, platform, render
ui (the toolkit)cupertino-kit, cupertino-ui-abi, cupertino-ui-controls, cupertino-ui-core, cupertino-ui-files, cupertino-ui-render, cupertino-ui-test, cupertino-ui-text, cupertino-ui-waylandfoundation, graphics, system, protocol, transport, ui
shellkit (the shell’s extension of the toolkit)cupertino-kit-shellfoundation, system, protocol, transport, ui
core (the compositor)cupertino-server, cupertino-server-backend, cupertino-server-input, cupertino-server-renderfoundation, graphics, models, system, platform, protocol, render, core
services (processes with no interface of their own)cupertino-audiod, cupertino-btd, cupertino-control, cupertino-netd, cupertino-portal, cupertino-powerd, cupertino-sessiondfoundation, models, system, platform, protocol, transport, services
shellcupertino-controlcenter, cupertino-dock, cupertino-launcher, cupertino-login, cupertino-menubar, cupertino-notifications, cupertino-osd, cupertino-prompts, cupertino-screenshot, cupertino-shell, cupertino-shell-agent, cupertino-shell-desktop, cupertino-shell-dialogs, cupertino-shell-overview, cupertino-windowmanagerfoundation, models, system, protocol, ui, shellkit, shell
appscupertino-files, cupertino-settingsfoundation, models, system, protocol, ui
toolscupertino-cli, cupertino-gpu-shaders, cupertino-gpu-slice, cupertino-layers, xtaskevery layer except core, shell, services, apps, testing
testing (test harnesses, tests that start programs from more than one crate)cupertino-session-testsevery layer

Further rules:

  • No crate reaches a higher layer through a chain of dependencies, also not through tools or testing.
  • foundation and models sources use no std::fs, std::net, std::process, std::env, std::thread, no unsafe and no FFI. Build scripts and tests/ are exempt.
  • A shell crate never depends on another shell crate, except the shell host on its components.
  • cupertino-wayland-client never reaches cupertino-protocols or the wlr, misc or plasma protocol crates; cupertino-app-protocols never reaches cupertino-protocols; cupertino-kit and the cupertino-ui-* crates never reach cupertino-protocols or cupertino-shell-client; cupertino-ui-render never reaches cupertino-ui-wayland or cupertino-wayland-client.
  • shell and apps crates reach the toolkit only through cupertino-kit, and cupertino-shell-client and cupertino-protocols only through cupertino-kit-shell (for shell crates).
  • Inside core, dependencies follow one direction (D25): cupertino-server-backend and cupertino-server-input depend on no other core crate; cupertino-server-render depends only on cupertino-server-backend; cupertino-server depends on all three.
  • Only cupertino-shell (and cupertino-kit-shell itself) may reference cupertino_kit_shell::hosting in src/.
  • External crates stay in their layers: Smithay in core only; the image, Wayland client, xkbcommon, wayland-server, zbus and system-call crates in the layers cupertino-layers lists for them.
  • Every shell and apps crate holds the clippy.toml that cupertino-layers writes, which disallows starting threads, block_on, std::fs, blocking bus calls and reading the theme data.
  • Every crate declares a licence.
  • Only a dev-dependency turns on cupertino-kit/test, and cargo build-programs names every other feature of the workspace’s packages.

cargo run -p cupertino-layers checks them all. Every layer is closed: the check fails on any problem, and no list excuses one. Test code outside a crate’s tests/ is refused by the gate of cargo xtask ci. Keyboard layouts come from the system’s libxkbcommon through the registry xkbcommon crate, the one Smithay uses too; the server keeps the last keymap that compiled when a new layout does not. crates/cupertino-layers/graph/layers.dot is a DOT snapshot of the layers (cargo run -p cupertino-layers -- --graph writes it).

Contracts registry

docs/architecture/contracts.yaml lists every Wayland global the server advertises, every D-Bus interface a Cupertino process serves and every binary a workspace crate builds. Each entry has its version, owner crate and area, threat scope (public, shell-private or system), and the file that defines it with a short text (source_match) found in it; the file’s header defines the fields. No tool checks the registry against the code: keeping it true is part of the change that touches an entry. unknown marks a value that is not measured yet.

The registry records the state of the code; it does not grant access. It covers D-Bus interfaces that Cupertino serves, not the interfaces it calls on other services. When a global, a served interface or a binary is added, removed or moved, change its entry in the same commit.

In-tree Linux interfaces

ReplacesComponentKernel interface
libudevcupertino-devicesNETLINK_KOBJECT_UEVENT, /sys
libinputcupertino-devices (evdev) and cupertino-inputevdev
libseat, logind clientcupertino-seatlogind’s D-Bus protocol (TakeControl, TakeDevice, pause and resume, VT switch)
alsa-libcupertino-audiod (its alsa module)/dev/snd/controlC* ioctls
UPower, backlight helperscupertino-powerd/sys/class/power_supply, /sys/class/backlight, lid switch over evdev
NetworkManager (development alternative)cupertino-netdrtnetlink, nl80211; iwd for authentication
BlueZ daemon (development alternative)cupertino-btdBluetooth management socket, L2CAP

Known limits

  • X11 programs need xwayland-satellite (0.8 or later) and Xwayland installed; without them the session serves Wayland clients only. Drag and drop between X11 and Wayland programs and per-output scales for X11 windows depend on the satellite (it uses one scale for all X11 windows), and none of it has been tested with real applications on hardware.
  • org.cupertino.Session1 authorizes mutating calls by process identity. Settings changes require the trusted Settings executable, the session agent (the agent component of the shell host) or the server. Application quitting requires the session agent or server. Listing and restarting the shell host’s components and the other supervised processes requires an unsandboxed process of the session’s own user. This does not make arbitrary same-user code a security boundary (see SECURITY.md).
  • VM evidence covers the TTY backend. The full real-hardware acceptance matrix remains open; see Roadmap.
  • Applications play audio through PipeWire. The Sound pane uses the session’s org.cupertino.Audio1 mixer. The volume overlay and control panel still use PipeWire and the ALSA playback fallback directly.