diff --git a/crates/bevy_window/src/lib.rs b/crates/bevy_window/src/lib.rs index e47320a9fb123f..02db232f9a6b86 100644 --- a/crates/bevy_window/src/lib.rs +++ b/crates/bevy_window/src/lib.rs @@ -22,7 +22,10 @@ pub mod prelude { } use bevy_app::prelude::*; -use bevy_ecs::{event::Events, schedule::SystemLabel}; +use bevy_ecs::{ + event::Events, + schedule::{ParallelSystemDescriptorCoercion, SystemLabel}, +}; /// The configuration information for the [`WindowPlugin`]. /// @@ -106,7 +109,10 @@ impl Plugin for WindowPlugin { } if settings.exit_on_all_closed { - app.add_system(exit_on_all_closed); + app.add_system_to_stage( + CoreStage::PostUpdate, + exit_on_all_closed.after(ModifiesWindows), + ); } if settings.close_when_requested { app.add_system(close_when_requested);