F14 — Window state & vetoable close
Minimize/maximize/fullscreen, focus, and the close request — the lifecycle edges. The exact event sequences for each transition are the deliverable; they feed event-sequences.md directly.
Requirements
- Keyboard shortcuts trigger: maximize toggle, minimize, fullscreen toggle, restore. Log the request AND every resulting event until the state settles:
- Wayland:
xdg_toplevel.set_maximized/set_fullscreen/set_minimizedand the resultingconfigurestates array (note: minimized is fire-and-forget — no state echo; that asymmetry is a finding). - X11:
_NET_WM_STATEClientMessages +WM_CHANGE_STATE; track_NET_WM_STATEproperty notifies andConfigureNotify. - Win32:
ShowWindow(SW_MAXIMIZE/SW_MINIMIZE),WM_SIZEwParams,WM_WINDOWPOSCHANGING/CHANGEDorder; fullscreen via the borderless-resize idiom (document it — Win32 has no fullscreen state). - macOS:
zoom:,miniaturize:,toggleFullScreen:and theNSWindowDelegate/notification sequence (fullscreen is a Space transition — log its duration).
- Wayland:
- Log focus/activation events (
focus state=in|out reason=…) including which surface object carries focus (Wayland:wl_keyboard.entervsxdg_toplevelactivated state). - Vetoable close: the demo has a "dirty" flag (toggled by a key). On close request (
xdg_toplevel.close/WM_DELETE_WINDOWClientMessage /WM_CLOSE/windowShouldClose:), if dirty: refuse once, logclose_requested veto=1, clear the flag; second request closes. Record per platform whether veto is a first-class concept or an app-side convention (Wayland/X11: the request is purely advisory; Win32/macOS: explicit return-value contracts). - Programmatic self-close paths must tear down cleanly (no protocol error, exit 0).
Instrumentation
state_request kind=…, state_changed states=[…], focus state=… , close_requested veto=0|1, plus configure/resize events.
Findings to record
- One ordered sequence diagram (as a log excerpt) per transition per platform.
- Which transitions echo back a state and which are fire-and-forget.
- Who owns "fullscreen" (a real state vs a geometry idiom).
- The veto contract per platform.
Verification
Wayland/X11: Tier A (headless weston honors state requests; Xvfb + a lightweight WM — run one, e.g. via nix shell nixpkgs#icewm — since bare Xvfb has no WM to answer _NET_WM_STATE; the no-WM behavior is itself worth one log). Win32: A[wine]. macOS: A[ssh] (fullscreen Space animation timing needs a real session — Tier C note).