From 5558e3509d020a0e021a77f0617044497b2f2aee Mon Sep 17 00:00:00 2001 From: salmonik Date: Mon, 17 Aug 2026 18:56:04 +0200 Subject: Windowed GUI: wm module, input routing, and the paint app - Add the wm window-manager facility per ADR 0004: overlapping pixel-surface windows, damage-rectangle compositing, WM-drawn title bar, focus/minimize/close, and F1-F4 keybindings - Add gop shadow compositing primitives and vt::repaint_region so the console stays layer 0 beneath windows - Route mouse (absolute coords, press/release edges) and keyboard (focus-aware input pump) to the focused window - Add the rspaint drawing-program crate (pen, 8 colors, clear) and shell draw/windows/restore commands - Extend TaskMsg with AppMouse/Focus/Close and document the design in CONTEXT.md + ADR 0004 --- CONTEXT.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'CONTEXT.md') diff --git a/CONTEXT.md b/CONTEXT.md index 48cb3a4..9fccbe4 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -77,6 +77,58 @@ Two-phase model matching output: The framebuffer address stays valid after `ExitBootServices` — the GPU's linear frame buffer is system memory that we own once boot services are gone. +## Window + +A rectangular display surface owned by exactly one task and composited +onto the 800×600 canvas by the window manager. The global console (vt) +becomes the first window, owned by the shell; further windows are spawned +per task (a terminal, a drawing canvas, …). Windows may overlap, so they +carry a z-order. Every window is a pixel surface: a terminal window is a +text grid rendered into its own pixels, a drawing canvas draws pixels +directly. The ruling constraint is "stupid simple". + +## Chrome + +Window-manager-owned UI drawn on the canvas but not a window: the +background/desktop fill, per-window title bars, and (later) a +launcher/menu. Chrome is not focusable and does not take input as a +window. + +## Title bar + +Per-window chrome strip at the top of a window showing the window's title +and its minimize and close buttons. Drawn by the window manager, not the +app. + +## Minimized + +A window state in which the window is not rendered (hidden); the app keeps +running. The inverse of the normal visible state. + +## Close + +The action that destroys a window and ends its app. + +## App + +A task that owns exactly one window and receives input events through its +message queue. A GUI program is an app; there is no separate "process" +concept — the app is its task plus its window. The console is app 0 +(window 0). + +## Focus + +The single window (if any) that receives keyboard and mouse input. Focus +is set by clicking a window, which also raises it; input is delivered to +the focused app's message queue. With no focused window, a click only +sets focus. + +## Keybinding + +A global keyboard shortcut handled by the window manager before input is +routed to the focused window. It triggers a WM action (spawn a terminal, +focus/restore the next window, close, …) and is never delivered to an app. + ## Keyboard layout Scancode set 1, US QWERTY layout. Hardcoded scancode→ASCII table. -- cgit v1.2.3