diff --git a/winit/src/program.rs b/winit/src/program.rs index e7d3294d73..0e1849ebbe 100644 --- a/winit/src/program.rs +++ b/winit/src/program.rs @@ -661,7 +661,7 @@ async fn run_instance( debug.startup_finished(); - 'main: while let Some(event) = event_receiver.next().await { + while let Some(event) = event_receiver.next().await { match event { Event::WindowCreated { id, @@ -929,7 +929,11 @@ async fn run_instance( && window_id != boot_window && window_manager.is_empty() { - break 'main; + control_sender + .start_send(Control::Exit) + .expect("Send control action"); + + continue; } let Some((id, window)) =