Skip to main content

Module host

Module host 

Source
Expand description

ToastHost — invisible sibling widget that owns the toast queue.

Installed by install_toast(opts) in the teksilo umbrella. The umbrella’s TeksiloAppBuilderToastExt::install_toast registers a DefaultPostRoot closure that wraps every window’s root with a ZStack of [user_root, ToastHost]. The host renders its toast surfaces as direct children, positioned absolutely at the configured viewport corner. The wrapping ZStack ensures toasts paint above the user content; the host itself fills the viewport (so its children — the toasts — have absolute screen coordinates to anchor against) and is event_pass_through outside the toast bounds so the user can still interact with content below.

No overlay system involvement — toasts are regular widgets in the arena. The host owns the per-frame timer + hover-pause; expired entries are removed from the registry’s queue, the version signal is bumped, the host rebuilds, the surface widgets are destroyed.

Routing: each host filters live_entry_ids() down to entries whose ToastRoute matches its own window id / assigned audience, or that are Broadcast. Every host binds the SAME ToastRegistry::version_signal at BindingLevel::Rebuild — one signal reaches N windows, because each window’s WidgetTree owns its own BindingRegistry and that registry remembers the generation it last reconciled (see teksilo_core::binding::BindingRegistry). A host that matches nothing in a given rebuild just produces zero new surfaces, which is cheap and lets one shared queue serve every window without a per-window registry.

Structs§

ToastHost
Invisible sibling widget that owns the toast queue. Installed once per window by the install_toast extension trait via a DefaultPostRoot closure (see teksilo::toast_install).
ToastInstallOptions
Configuration for the installed ToastHost. Passed to install_toast in the teksilo umbrella crate.