ui-contract: a window's builder carries the app's hidden state only until its first pass, so a palette hidden later gets one Visible command

This commit is contained in:
bflatastic
2026-11-22 09:24:32 +07:00
parent b5a630acfb
commit 7e87adadd4
@@ -98,8 +98,9 @@ pub(crate) fn show_viewport(ctx: &Context, open: &ViewportOpen<'_>, mut body: im
level: standing.level,
resizable: open.resizable,
taskbar: spec.taskbar,
// The builder's visibility opens a window the app's state hides already hidden.
hidden: PerViewport::<Record>::with(ctx, viewport, |record| record.awaiting_first_paint) || hidden,
// The builder's visibility opens a window the app's state hides already hidden, and only opens it: egui would
// send each later change of it as a command beside the one below.
hidden: PerViewport::<Record>::with(ctx, viewport, |record| record.awaiting_first_paint || (hidden && record.facts.is_none())),
active: spec.takes_focus,
passes_pointer: spec.passes_pointer,
app_id: &app,