← Blog
VIDEO · DRIVERS · 0.6.0

LCARS WM Suite: Resize Feedback, Snap Zones, Focus Chrome + PS/2 i8042 Controller

June 22, 2026 · sigil-video / sigil-drivers · Sigil-Docs
video lumen wm theme drivers input 0.6.0

Three window-management primitives land in lcars_theme.sg that complete the interactive LCARS WM layer: lcars_resize (border_rect + resize handles + drag-feedback overlay), lcars_snap_zones (bitmask edge indicators for window snapping, called per drag-move), and lcars_focus_chrome (two-tone window chrome for focused vs. background windows). sigil-drivers adds the Intel 8042 PS/2 controller (keyboard + mouse, x86 CLS_INPUT). A CODEC-PASS x86 also lands via a hand-built RLE test that works around the cc0.seed bootstrap bug. (sigil-video 36d078a, 52205de, 8a5f47b; sigil-drivers b0f782a)

lcars_resize_feedback: 2px orange border + 4 tan corner handles during drag-resize
lcars_resize_feedback: 2px orange border + 4 tan corner handles during drag-resize. LCARS-RESIZE-PASS.
lcars_snap_zones: blue edge bars, orange top bar, gold center-top maximize indicator
lcars_snap_zones: blue edge bars (left/right), orange top bar, gold center-top maximize indicator. LCARS-SNAP-PASS.
lcars_focus_chrome: orange pill+tan accent (focused), purple pill+ltblue accent (unfocused)
lcars_focus_chrome: orange pill+tan accent (focused), purple pill+ltblue accent (unfocused). LCARS-FOCUS-PASS.

lcars_resize — drag-resize overlay (36d078a)

Three drawing primitives together handle drag-resize feedback:

lcars_border_rect
lcars_border_rect(fb,pitch,x,y,w,h,bw,color) — hollow rectangle via 4 fill_span strips. The resize/focus ring primitive. Fills top, bottom, left, right bands; interior is untouched.
lcars_resize_handle
lcars_resize_handle(fb,pitch,fbw,fbh,cx,cy,sz,color) — filled corner square at (cx,cy). Called 4× by resize_feedback at each window corner.
lcars_resize_feedback
lcars_resize_feedback(fb,pitch,fbw,fbh,rx,ry,rw,rh) — full drag-resize overlay: 2px orange border + 4 tan corner handles. OS calls per mouse-move during drag. GPU path: gpu_submit (CAP_ACCEL; silicon-pending); SW: lcars_fill_rect fill_span rows.

Test: border_rect top/bot/left/right strips verified + hollow interior confirmed; resize_feedback: handle pixel=tan, border=orange, interior=0. LCARS-RESIZE-PASS (all 8 oracles ok).


lcars_snap_zones — edge snap indicators (52205de)

lcars_snap_zones(fb,pitch,fbw,fbh,zones,zone_w) is called per drag-move when a window nears a screen edge. The zones argument is a bitmask:

zones=0 clears all indicators. The compositor calls lcars_snap_zones on each drag-move event and again with zones=0 on drop, so indicators never persist after the drag ends.

Test: 4 zone configurations (left-only, left+right, top, maximize). All 7 oracles ok. LCARS-SNAP-PASS.


lcars_focus_chrome — two-tone window chrome (8a5f47b)

lcars_focus_chrome(fb,pitch,fbw,fbh,wx,wy,ww,bh,focused) repaints the chrome region of a window based on focus state. Only the chrome band is repainted — no full window redraw needed on focus change.

focused=1
Orange pill + black title area + tan accent bar. Active window chrome. GPU: gpu_submit rect-fill (CAP_ACCEL); SW: lcars_hbar + fill_span rows.
focused=0
Purple pill + black title area + ltblue accent bar. Background window chrome — visually recedes from the active window.

Test: 6 oracles (pill + title + accent for each focus state). LCARS-FOCUS-PASS.


LCARS WM API surface — 14 public functions

core/lcars_theme.sg now exposes 14 public functions covering the full LCARS WM layer:

FunctionPurpose
lcars_fill_rect / lcars_fill_circle / lcars_fill_qcircle_brPrimitives
lcars_hbar / lcars_elbowBar primitives
lcars_border_rect / lcars_resize_handleResize primitives
lcars_panel_header / lcars_labelDesktop chrome
lcars_progress / lcars_data_stripData widgets
lcars_window_chrome / lcars_wchrome_title / lcars_focus_chromeWindow chrome
lcars_statusbarBottom bar
lcars_resize_feedback / lcars_snap_zonesInteractive WM

i8042 PS/2 controller — sigil-drivers (b0f782a)

The Intel 8042 is the PS/2 controller found in every x86 PC — it manages both the keyboard and mouse interfaces via two separate channels. This is the second real port-I/O driver in sigil-drivers after the MC146818A RTC (ports 0x70/0x71). Together they wire the x86 real-hardware boot's two most essential non-MMIO peripherals.

The driver is live-verified on real QEMU 8042 via actual I/O port access:

CLS_INPUT dispatcher handles OP_INIT / PROBE / READ / CTL. Status polling uses integer division (no bitwise ops, matching the Sigil constraint). State mapped at 0x820000. x86-runverify PASS.


CODEC-PASS workaround (36d078a)

tests/test_codec.sg lands alongside lcars_resize. The cc0.seed bootstrap carries a LSRA nested-loop bug (even after the source fix in 63e04cc) because the old seed compiled the new cc0.sg — a chicken-and-egg that cannot be broken by patching the source alone.

Workaround: hand-build the 3-run RLE stream with poke32 (no nested loops), making the test LSRA-immune. Tests covered: codec_rle_decode round-trip, hal_bind routing (HW→1, CPU→0), frames_match. CODEC-PASS hw=ok cpu=ok match=ok.