Expand description
window service handlers — MarkWindowOpen and InheritWindowAppearance:
a new window opens with the theme and opacity of the window that created
it (docs/specs/SPEC_PER_WINDOW_THEME_AND_OPACITY_2026_10_12.md §6).
The creator takes a mark (MarkWindowOpen), opens the window, learns its
host label from that call’s return, and then calls
InheritWindowAppearance with its own window id, the label and the mark.
The new window’s renderer creates its Window row (CreateWindow) at about
the same moment, so the two calls race. Each side first publishes what it
has, then checks for the other: InheritWindowAppearance records a
pending entry and then looks for the row; CreateWindow records its row
and then takes any pending entry. Whichever side takes the entry applies
it, so it is applied exactly once whatever the order.
Host labels are reused: a pool window can be demoted and promoted again straight away, and the old row can outlive that (its close runs on another thread). The mark is what tells the new row from the old one. Marks and row records share one counter, so a row created after the mark was taken is the one this open made; any older row for the label belongs to an earlier use of it and never takes the entry.
Structs§
- Pending 🔒
Constants§
- INHERITED_
KEYS 🔒 - The per-window appearance keys a new window copies from its creator.
- PENDING_
TTL 🔒 - How long a pending entry waits for its window. A new window creates its row within a second or two of being opened.
Statics§
- CREATED 🔒
- host label → (the window id
CreateWindowlast made for it, its sequence, when). - PENDING 🔒
- host label → the inheritance waiting for that label’s new row.
- SEQ 🔒
- Orders marks and row records: every mark and every recorded row gets the next value.
Functions§
- appearance_
patch 🔒 - The source window’s appearance keys that are set, as a meta patch.
Nonewhen the source is gone or has none of them set. - apply_
inheritance 🔒 - Copy
source_window_id’s appearance ontotarget_window_id. Returns the events to publish; empty when there is nothing to copy. - handle_
inherit_ 🔒window_ appearance - Args:
sourceWindowId,hostLabel(the new window’s host label),mark(fromMarkWindowOpen, taken before the window was opened). - handle_
mark_ 🔒window_ open - No args. Returns a mark to pass to
InheritWindowAppearance; take it before opening the window. - next_
seq 🔒 - record_
created 🔒 - Called by
CreateWindowonce the row exists, before it takes a pending entry. Returns the row’s sequence, fortake_pending. - record_
pending 🔒 - take_
pending 🔒 - Take the pending source for
labelif a row with sequencerow_seqis the one it waits for: recorded after its mark, and the entry still fresh.