From 4d856d5240b468e0263edb36b6947934f33d1a9a Mon Sep 17 00:00:00 2001 From: IceSentry Date: Mon, 4 Sep 2023 13:30:32 -0400 Subject: [PATCH 1/3] wait before toggle window visibility --- examples/window/window_settings.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/examples/window/window_settings.rs b/examples/window/window_settings.rs index 37ae2ea80f860..517aa23898231 100644 --- a/examples/window/window_settings.rs +++ b/examples/window/window_settings.rs @@ -35,7 +35,6 @@ fn main() { LogDiagnosticsPlugin::default(), FrameTimeDiagnosticsPlugin, )) - .add_systems(Startup, setup) .add_systems( Update, ( @@ -46,16 +45,21 @@ fn main() { toggle_window_controls, cycle_cursor_icon, switch_level, + toggle_visible, ), ) .run(); } -fn setup(mut primary_window: Query<&mut Window, With>) { - // At this point the gpu is ready to show the app so we can make the window visible - // There might still be a white frame when doing it in startup. - // Alternatively, you could have a system that waits a few seconds before making the window visible. - primary_window.single_mut().visible = true; +fn toggle_visible(mut primary_window: Query<&mut Window, With>, time: Res