setScreenMasked
Raises (masked true) or lifts the mask on the frame handle refers to. A mask is 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.
Lifting it puts the frame's contents back in charge: a mask sits over them without erasing them, and update keeps revising them while it is up. So a frame that names nothing — the usual mask — lets the screen beneath it show through again, and one that names a screen of its own resolves to that.
A mask is not whether the surface is on display. It answers "does this surface name a screen?", which does not stop being true while the surface is off-screen; whether the frame participates at all is setActive's question. Two switches for two different questions — folding them into one is what makes a mask outlive the moment it was right for. What can change the answer is the surface itself: a container that stops hosting the content that named its screens, and names its own again.
Changing both what a frame names and whether it masks takes two calls, each publishing a snapshot. Order them so that the one in between is still true of the frame: to go from masking to naming, update the screen first and lift the mask second (the intermediate snapshot still masks); to go the other way, raise the mask first and update second. The opposite order republishes, for an instant, a context in which the screen underneath this surface shows through — which a lock-free reader of current can observe.
A no-op (and no snapshot churn) if the frame already has that value, was already removed, or belongs to another stack. Never changes whether the frame is active.