Files
chandra/wit/wm/policy.wit
VandClaude Opus 5.5 af774d76fe
CI / test (push) Failing after 16s
Rename the project to Chandra
moon-plasma / moonplasma / MoonPlasma / Moon Plasma become chandra / Chandra
everywhere: the WIT package (chandra:desktop, chandra:host, chandra:wm), the
MoonBit module (chandra/desktop) and generated bindings, the Rust host,
identifiers (ChandraCompositor), the session script (chandra-session) and
desktop entry (chandra.desktop), config and data paths
($XDG_CONFIG_HOME/chandra, share/chandra/modules), env vars (CHANDRA_*),
UI strings, docs and tests. The test fixture components are rebuilt against
the renamed WIT.

Saved panel.edn and state.edn are still read from the old
$XDG_CONFIG_HOME/moon-plasma until the first save writes the new copy.

The remote repository keeps its experiments/moon-plasma name for now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hi3L9oVBoRd373Qr4n
2026-11-25 17:12:57 +00:00

72 lines
1.7 KiB
Plaintext

package chandra:wm@0.2.0;
interface policy {
use chandra:desktop/types@0.1.0.{rect, size, point};
type window-id = u64;
flags window-caps {
can-move,
can-resize,
can-maximize,
can-minimize,
can-fullscreen,
}
enum layout-mode {
floating,
tiling,
monocle,
}
record window-state {
id: window-id,
app-id: string,
title: string,
geometry: rect,
min-size: size,
max-size: option<size>,
focused: bool,
maximized: bool,
fullscreen: bool,
workspace: u32,
caps: window-caps,
}
variant window-request {
maximize(bool),
fullscreen(bool),
minimize(bool),
close,
activate,
move-to(point),
resize-to(size),
}
variant wm-action {
set-geometry(tuple<window-id, rect>),
focus(window-id),
raise(window-id),
close(window-id),
set-maximized(tuple<window-id, bool>),
set-fullscreen(tuple<window-id, bool>),
}
variant input-target {
client(tuple<window-id, point>),
decoration(tuple<window-id, point>),
shell-panel(point),
none,
}
/// Called on startup or WM hot-swap to synchronize existing windows.
sync-windows: func(outputs: list<rect>, windows: list<window-state>) -> list<wm-action>;
on-window-open: func(win: window-state, work-area: rect) -> list<wm-action>;
on-window-close: func(id: window-id) -> list<wm-action>;
on-window-request: func(id: window-id, req: window-request, work-area: rect) -> list<wm-action>;
on-pointer: func(pos: point, button: option<u32>, pressed: bool) -> input-target;
set-layout-mode: func(mode: layout-mode, work-area: rect) -> list<wm-action>;
/// Returns window IDs in bottom-to-top Z-order.
stacking-order: func() -> list<window-id>;
}