Skip to main content

adopt_initial_window

Function adopt_initial_window 

Source
pub fn adopt_initial_window(root: RNode, scope: Scope)
Expand description

Adopt the app’s first window into the registry, so it is an ordinary primary window rather than a privileged one (docs/windows.md close policy).

Called once at boot with the root container the backend handed back. scope owns the root content, so closing this window disposes exactly its tree and nothing else, which is why the caller builds that content in a child of the root scope rather than in the root scope itself. State an app wants to outlive its windows still does: Signal::global lives on the root scope, above this one.