maskScreen

fun maskScreen(handle: ScopeHandle)

Turns the frame handle refers to into a mask: a frame that declares there is no screen here, clearing both screen and section rather than naming one. Frames after it still win, so a mask hides what is underneath it, not everything.

It exists for a surface that comes to the foreground and names no screen of its own — a native container hosting content that reports its own screens. Without a mask, the frame of the screen underneath stays the innermost one and every event captured on the unnamed surface is attributed to the screen the user just left: a wrong value, not a missing one, and one that survives every schema check.

One-way, and deliberately so. A mask is a statement about the frame's contents — this surface names no screen — which does not stop being true while the surface is off-screen. What changes then is whether the frame participates at all, and that is setActive's job. Two switches for two different questions; folding them into one is what makes a mask outlive the moment it was right for.

A no-op if the frame is already masked, was already removed, or belongs to another stack.