pub struct OverlayContext { /* private fields */ }Expand description
A per-surface overlay registry: the modals/toasts/tooltips registered for priority pointer routing
on this surface. The runner activates each surface’s OverlayContext around its build/event/frame.
Implementations§
Source§impl OverlayContext
impl OverlayContext
Sourcepub fn enter(&self) -> OverlayGuard
pub fn enter(&self) -> OverlayGuard
Makes this instance the live one until the returned guard drops, which restores the previously-active instance. Nest by keeping guards in scope; they restore in reverse order.
Sourcepub fn enter_ambient() -> OverlayGuard
pub fn enter_ambient() -> OverlayGuard
Makes the ambient instance — the one that exists before any surface is built, and the only world a single-surface app ever has — live until the returned guard drops.
What the reactive flush needs for an effect owned by SurfaceHandle::NONE:
it was registered outside any surface, so its world is this one, and running it against
whichever surface happened to be entered when the signal fired would resolve its layout,
overlays and focus in somebody else’s. Reachable as soon as one app has both — a window tree
that never built a surface and a second tree that did.