Skip to content

Control-socket IPC coverage ​

On this page ​

How every message on the two IPC transports is covered by headless integration tests. The companion reference is docs/ipc.md (the protocol tables) and docs/ipc.md's two tables are the source of the enumeration; this file is the audit of what is exercised end-to-end (a real compositor, started headless, driven over the control socket) versus what is only parsed (serde unit tests in crates/viewport-ipc) or only exercised on the shell side (tests/shell.test.js stubs the DOM — it never starts a compositor).

How the count was done ​

  • 150 distinct wire names at current tip (110 Request variants in crates/viewport-ipc/src/request.rs and 43 Event variants in crates/viewport-ipc/src/event.rs; session.lock, session.unlock and shell.command appear in both). The original 2026-11-11 sweep below covered the 115 wire types that existed then (74 Request + 41 Event); variants added since (view.blur, view.confine_pointer, view.anr_resolve, view.decorations, view.anr, view.anr_resolved, and the 32 runtime config.* setters) are listed in docs/ipc.md and exercised in crates/viewport/tests/control_socket.rs, anr_dialog.rs, confine_pointer_rule.rs, and tests/shell.test.js. The page bridge (js.rs / BRIDGE_SHIM) carries the same set as the UNIX socket, so "both transports" adds no new names.
  • Integration means headless apply + wire: a test that starts a --headless compositor and sends the message over the control socket (viewport msg in tests/*.test.sh, raw lines in crates/viewport/tests/*.rs via common), then asserts the answer fields and an observable state change (the next query's reply, a subscribed event, a foreign-toplevel state, a file, or a log line). Pure serde round-trips and shell.test.js behaviour are useful but are not counted as integration here.
  • Existing before this audit counted both harnesses: the shell suite (tests/*.test.sh via scripts/integration.sh) and the Rust suite (crates/viewport/tests/control_socket.rs, msg_cli.rs, wallpaper.rs, background.rs). The gaps below were the ones neither exercised.
  • New tests are all shell tests sending via viewport msg (-t or --raw, which is still viewport msg through the compositor's own parser), following the existing conventions: private runtime/state dirs, socket read from the log, check helper, PID-only cleanup.

Two defects were found while covering the gaps and are fixed in FIXES.md as entries 55 and 56. Each was first asserted as an expected failure (known_fail), and the expected failures are now plain checks.

#DefectFound by
55config.gaps/config.border: a partially invalid message (valid first field, negative second) reported the refusal but the valid half stayed applied, silently diverging from what the shell was last toldconfig-output-ipc
56viewport msg -t omitted five request types (view.opacity_rule, view.tearing, view.idle_inhibit, gesture.capture, ai.login): they exited 2 "unknown message type" without sending anything, while --raw delivered themview-ipc, shell-session-ipc, services-ipc

viewport msg itself validates before sending, which shapes the error paths below: parse-level failures (unknown type, missing field, wrong type, field the message does not have) are refused at the prompt with exit 2 and never reach the compositor; handler-level refusals are exit 1 with "viewport msg: <context>: <reason>" on stderr (the error event the compositor answered with, read out from behind the barrier in msg.rs). Nonexistent view/notification ids are silently ignored (exit 0) everywhere — a stale id is a race, not a refusal — and the tests assert acceptance plus liveness rather than an error.

Shell → compositor (requests) ​

MessageExisting integration (before)New headless testResult
view.layoutX11 only (xwayland-warp-hint, xwayland-capture-overlay: send + capture)view-ipc (Wayland paint window: accept + placement log line)pass
view.visible—view-ipc (accept + still listed, re-shown by layout)pass
view.fullscreen— (foreign protocol only)view-ipc (foreign fullscreen=1/0 + window.fullscreen.set replay)pass
view.maximized— (foreign protocol only)view-ipc (foreign maximized=1/0)pass
view.minimized— (foreign protocol only)view-ipc (foreign + replayed minimized flag + focus drop)pass
view.focusuntrusted refusal only (control_socket.rs)view-ipc (functional: view.focused)pass
view.close— (foreign close() is protocol, not socket)view-ipc (view.removed + client exits)pass
view.opacity—view-ipc (accept; render-only state; out-of-range clamped)pass (acceptance)
view.opacity_rule—view-ipc (-t and --raw)pass
view.capturecapture.test.sh (private grant survives retitle)— (reused: nonexistent-id silent case in view-ipc)pass (existing)
view.tearing—view-ipc (-t and --raw)pass
view.idle_inhibit—view-ipc (-t and --raw)pass
view.querycontrol_socket, msg_cli, capture, warp testshelper in every new testpass
background.focusbackground.rs (log: keyboard moves)—pass (existing)
shell.focus—shell-session-ipc (view.focused 0)pass
screencast.rect—shell-session-ipc (accept; same set_shell_overlays path as shell.overlay)pass (acceptance)
shell.overview—shell-session-ipc (accept; window still listed)pass (acceptance)
session.save—shell-session-ipc (round-trip via session.query)pass
session.query—shell-session-ipc (session.restore fields)pass
session.locklock-builtin (black screen + log)shell-session-ipc (session.lock event fields)pass
session.lock.drawnlock-builtinshell-session-ipc (stale dropped + current heard, log)pass
session.unlocklock-builtin (wrong password stays locked)shell-session-ipc (stale dropped; wrong password → session.lock.error)pass (valid-password unlock needs real credentials, see below)
notification.actionnotification-centre—pass (existing)
notification.dismiss—services-ipc (no socket close; history keeps)pass
notification.expirenotification-centreservices-ipc (no socket close; history keeps)pass
notification.listcontrol_socket (private) + notification-centrehelper (history_now)pass
notification.forgetnotification-centre—pass (existing)
tray.activatetray.test.sh—pass (existing)
clipboard.querycontrol_socket (private) + clipboard.test.sh—pass (existing)
clipboard.pasteclipboard.test.sh—pass (existing)
clipboard.forgetclipboard.test.sh—pass (existing)
launcher.query—config-output-ipc (launcher.list fields, filter, generation)pass
launcher.launch—config-output-ipc (stale/bad-id refusals + Foot launch → new view)pass
mpris.controlmpris.test.sh (play-pause/next + unknown no-op)—pass (existing)
ai.login—services-ipc (bogus provider → error, over -t and --raw). The openai flow would reach the network, so it is not started.pass (error path)
power.profile—services-ipc (unadvertised name dropped, acceptance). Standard names would switch the host profile, so they are not sent.pass (acceptance)
power.action—services-ipc (invalid verb refused). Valid verbs go to logind on the system bus and would suspend/reboot/power off the machine, so they are never sent.pass (error path)
osk.key—services-ipc (down/up acceptance)pass (acceptance)
network.scan—services-ipc (network.update fields)pass
network.connect—services-ipc (unknown ssid acceptance); missing ssid usage errorpass
network.disconnect—— (would leave the operator's network; no fields, so no error path either)not tested (safety)
network.radio—— (would switch off the operator's radio)not tested (safety)
bluetooth.power—— (would power down the operator's adapter)not tested (safety)
bluetooth.scan—services-ipc (bluetooth.update fields)pass
bluetooth.device—services-ipc (unknown action ignored, acceptance)pass
tray.menu.clicktray.test.sh—pass (existing)
tray.menu.closedtray.test.sh—pass (existing)
tray.scrolltray.test.sh—pass (existing)
shell.overlayxwayland-capture-overlay (hit-test)— (same path as screencast.rect, which is covered)pass (existing)
workspace.listxkcd workspace.test.sh (workspace.test.sh)—pass (existing)
output.configurecontrol_socket (mirror, scale, revert)—pass (existing)
output.hdrmsg_cli (unknown output)config-output-ipc (unknown output, and the headless renderer refusal). Success needs a colour-managed renderer, the drm backend and a capable head, so headless can only refuse — and the renderer is the first reason.pass (error paths)
output.confirmcontrol_socket—pass (existing)
output.revertcontrol_socket—pass (existing)
output.active—config-output-ipc (active flags; unknown refused)pass
gesture.capture—shell-session-ipc (-t with and without --gestures, and --raw). Takes effect only at the next real gesture.begin.pass
output.querycontrol_socket, output-order, msg_clihelperpass
output.test_addcontrol_socket, output-ordersetup in config-output-ipcpass
output.test_removecontrol_socket (mirror, churn)config-output-ipc (remove + unknown)pass
bind.add—config-output-ipc (keymap announcement; invalid refused; replace)pass
shell.commandcontrol_socket, msg_cli—pass (existing)
shell.exec—config-output-ipc (file created on host)pass
status.refresh—config-output-ipc (acceptance)pass (acceptance)
status.volume—config-output-ipc (delta 0 acceptance; unknown target refused; no real volume change is asserted)pass
input.pointerwarp/overlay tests—pass (existing)
input.buttonxwayland-capture-overlay—pass (existing)
input.key—view-ipc (press/release acceptance)pass (acceptance)
input.scroll—view-ipc (notch + empty no-op)pass (acceptance)
quitcontrol_socket, msg_cli—pass (existing)
config.gapscontrol_socket (persistence only)config-output-ipc (next-config fields; atomic refusal)pass
config.border—config-output-ipc (next-config fields; atomic refusal)pass
config.wallpaperwallpaper.rsconfig-output-ipc (shell parity: fields, atomic refusals, removal)pass
config.dark_modecontrol_socket + appearance.test.sh—pass (existing)
config.savecontrol_socket (persistence)config-output-ipc (config.saved path, overlay contents, config untouched)pass

Error paths are asserted alongside the success paths above (not as a separate suite): unknown type over -t and over --raw (usage errors, exit 2), missing fields, wrongly-typed fields, fields a message does not have, handler refusals (exit 1 with the error context), and nonexistent ids (silently ignored, exit 0, still listed/alive). The compositor-side error event for malformed JSON / unknown type / non-string type is already covered in control_socket.rs; it cannot be produced through viewport msg, which refuses those before sending anything.

Compositor → shell (events) ​

EventExisting integration (before)New headless testResult
view.addedcontrol_socket (watchdog), xwayland-float (subscribe), view.queryview-ipc (fields)pass
view.removed—view-ipc (after view.close)pass
view.propsshell.test.js onlyview-ipc (retitle → props + query agree)pass
view.parent—— (needs an xdg-foreign dialog; neither test client creates one)not tested (client limit)
view.configured—view-ipc (Foot 1x1 → 6x13; in-minimum silence)pass
view.focused—view-ipc + shell-session-ipcpass
workspace.requestworkspace.test.sh—pass (existing)
configcontrol_socket, msg_cli(view.query helper)pass
config.savedcontrol_socketconfig-output-ipcpass
modifiers—— (physical-key path only under bar: "auto"; inject_key does not emit it, so there is no socket way to produce one)not tested (synthetic-path limit)
session.restore—shell-session-ipcpass
session.locklock-builtin (pixels + log)shell-session-ipc (socket fields)pass
session.lock.errorlock-builtin (stays locked, log)shell-session-ipc (socket event + generation)pass
session.unlocklock-takeover (external locker)— (a correct password needs real credentials)not tested (credentials)
notification.add— (centre reads history, not add)services-ipcpass
notification.close—services-ipc (sender withdrawal only; dismiss/expire emit no socket close)pass
notification.historynotification-centrehelperpass
tray.updatetray.test.sh—pass (existing)
tray.menutray.test.sh—pass (existing)
clipboard.historyclipboard.test.sh—pass (existing)
launcher.list—config-output-ipcpass
mpris.updatempris.test.sh—pass (existing)
power.update—— (worker is change-coalesced and the default snapshot is the empty one, so battery-less machines suppress it forever; no test could assert fields without battery hardware)not tested (hardware)
osk.wanted—— (needs zwp_text_input_v3 + touch + auto; headless settles wanted: false and would only assert the false edge)not tested (hardware)
network.update—services-ipcpass
bluetooth.update—services-ipcpass
status.updatecontrol_socket, msg_cli(status.refresh acceptance)pass (existing)
ai.usage—— (needs configured provider credentials)not tested (credentials)
ai.auth—— (needs a real OAuth flow; ai.login refusal is covered)not tested (credentials)
output.layoutcontrol_socket, output-orderhelperpass
shell.command (event)control_socket, msg_cli(window.fullscreen.set replay in view-ipc)pass
gesture.begin/gesture.update/gesture.end—— (need a real touchpad; gesture.capture only declares ownership)not tested (hardware)
screencast.pick/screencast.pick.done—— (need a portal chooser drawn by a shell; the restore suite drives the portal over D-Bus, not these socket events)not tested (chooser)
screencast.active—shell-session-ipc (replay: active: false)pass
shortcuts.pick/shortcuts.pick.done—— (need the portal + a chooser dialogue; see global_shortcuts.rs for the bus half)not tested (chooser)
shell.reload—— (only from --watch-shell file changes / reconnect; input.key cannot reach the configured reload binding, so there is no socket trigger)not tested (trigger limit)
errorcontrol_socket (malformed, unknown, bad type) + msg_cli (--raw)new error paths via viewport msg (exit 2 / exit 1 strings)pass

Documentation gaps closed alongside ​

docs/ipc.md was missing rows for ai.login, shell.exec, status.refresh, view.tearing, view.idle_inhibit (shell → compositor) and ai.auth, ai.usage, shell.reload (compositor → shell); they have been added. view.opacity_rule, view.tearing, view.idle_inhibit, gesture.capture and ai.login were documented but not offerable by viewport msg -t (FIXES 56, now fixed).

A layer surface's menu is unconstrained against the layer's own rectangle (commit 3370dafd), and that behaviour has no test — a limit on the client side, like view.parent above. An xdg_popup reports no position of its own, so a headless test has nothing on the wire to assert: the popup sits where the compositor put it and says nothing about it to anyone. A future test needs a client that reads its popup's position back — via xdg_popup.get_geometry against what the layer commanded — or a compositor trace assertion that the popup's unconstrained rectangle is the layer's own rectangle rather than the toplevel's.

Compositor licensed under GPL-3.0-or-later · Protocol, shell, bridges and renderer licensed under MIT.