Module splash

Module splash 

Source
Expand description

Native pre-splash for Windows: a borderless layered popup showing the AgentMux brain logo (pulsing) on a solid dark background while CefInitialize runs (200–600 ms cold start).

spawn_splash(dir_hash) is called right after the single-instance pipe is claimed — before srv spawn, before CEF init (~10 ms into the launcher process). The returned event name is passed to the CEF host as AGENTMUX_SPLASH_EVENT; the host signals it from on_load_end to trigger a smooth fade-out.

§Layout & animation

┌─ SPLASH_SIZE × SPLASH_SIZE ─┐
│ solid BG_COLOR              │
│   ┌─ BRAIN_W × BRAIN_H ─┐   │
│   │ brain glyph        │   │   ← pulsing alpha 160..220
│   │ (transparent png)  │   │
│   └────────────────────┘   │
│                            │
└────────────────────────────┘

The background is fully opaque and never changes. ONLY the brain glyph’s alpha pulses (sine wave, 1.1 Hz). Painted via UpdateLayeredWindow + a pre-multiplied 32-bpp DIB section, so per-pixel transparency works correctly (the previous SetLayeredWindowAttributes(LWA_ALPHA) pulsed the whole window together, which made the background appear to breathe too — see docs/retros/2026-05-13-splash-icon-and-pulse-target.md).

Structs§

SendHandle 🔒

Constants§

BG_B 🔒
BG_G 🔒
BG_R 🔒
BRAIN_H
BRAIN_W
BRAIN_X 🔒
BRAIN_Y 🔒
SPLASH_PADDING 🔒
SPLASH_SIZE 🔒

Statics§

BRAIN_BGRA 🔒

Functions§

composite 🔒
Compose one frame into the DIB: solid BG fill, then the brain blended on top at brain_alpha.
fade_out 🔒
Fade the splash window to transparent over ~160 ms then return. Composite stays the same; only the layered-window constant alpha ramps down, so the whole splash fades uniformly.
push_layered 🔒
run_splash 🔒
spawn_splash
Spawn the pre-splash thread and return the named Win32 event name to pass to the CEF host as AGENTMUX_SPLASH_EVENT. Returns None if OS calls fail (non-fatal — launcher continues).