The Phosphor.OSD on-screen-display framework: the transient overlays a shell flashes for volume, brightness, mic-mute, caps-lock, and the like. Pure QML, themed through `phosphor-theme` and built on the `phosphor-shell-widgets` atoms.
Phase 3.3 deliverable per Lambent's docs/design/04-implementation-plan.md.
Own the lifecycle of the transient OSD surface: show one OSD at a time, hold it for a timeout, fade it out, and route triggers to the right screen. Debounce/dedupe repeated triggers so spinning a volume key keeps one OSD alive and refreshed instead of stacking surfaces.
The framework owns presentation and timing only. The OSD content is supplied by delegates (the four built-ins here, or plugin-contributed ones), and the triggers come from the host (a hotkey handler, an IPC call, a service signal).
| Component | Role |
|---|---|
| OSDHost | Per-screen OSD surface manager: one-at-a-time display, hold timer, debounce/dedupe, fade, screen routing. |
| OSDCard | Shared chrome: a screen-edge band that draws out along the edge, with a glyph, label, and optional progress. Not a centred card. |
| VolumeOSD | Speaker glyph + progress; muted cross at zero. value is 0..100. |
| BrightnessOSD | Sun glyph + progress. value is 0..100. |
| MicOSD | Microphone glyph; active true = muted (red slash + label). |
| CapsLockOSD | Caps-lock glyph; active true = on (primary-tinted + label). |
import Phosphor.OSD
OSDHost {
id: osd
anchors.fill: parent
screenName: "DP-1"
provider: registryProvider // createOSD(kind, parent) -> Item
}
// elsewhere, on a volume key / IPC call:
osd.show("volume", 62, undefined, "DP-1")provider is any object exposing createOSD(kind, parent) -> Item. In the shell it is backed by a Registry<IOSDFactory> (the OSD demo wires this and registers the four built-ins as IOSDFactory instances). A delegate is expected to carry value (0..100) and/or active (bool). OSDHost sets whichever it exposes.
The host owns the delegate's lifetime and destroys it on swap/hide, so a provider MUST return a destroyable item. A C++ factory (the IOSDFactory path) must set QQmlEngine::setObjectOwnership(item, QQmlEngine::JavaScriptOwnership) before returning it. A QObject-parented item defaults to CppOwnership, which makes the host's destroy() throw ("indestructible object") and leaves a ghost stacked behind the next OSD.
Multi-screen: instantiate one OSDHost per monitor (via Phosphor.Shell's PerScreen), give each its screenName, and pass the same trigger to all. show()'s targetScreen argument routes it (""/omitted = every screen).
Shipped. OSDHost, the band chrome, and the four built-in OSDs are in the tree with a QtQuickTest suite and an acceptance demo (../../examples/phosphor-osd-demo/, driven by phosphorctl call osd.show). The edge-band form and the window-edge anchoring landed with the spectrum identity work; OSDHost takes placementMap, edgeMargin and topInset, and reports anchoredToWindow.