From bf514ff12c7d83d568766fa136ac6bc5da063087 Mon Sep 17 00:00:00 2001 From: akimakinai <105044389+akimakinai@users.noreply.github.com> Date: Mon, 13 Feb 2023 19:15:24 +0000 Subject: [PATCH] Fix closing window does not exit app in desktop_app mode (#7628) # Objective - `close_when_requested` system needs to run before `exit_on_*` systems, otherwise it takes another loop to exit app. - Fixes #7624 ## Solution - Move `close_when_request` system to Update phase [as before](https://github.com/bevyengine/bevy/issues/7624#issuecomment-1426688070). --- crates/bevy_window/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/bevy_window/src/lib.rs b/crates/bevy_window/src/lib.rs index 03b270c693d44..b8df45eca2f6e 100644 --- a/crates/bevy_window/src/lib.rs +++ b/crates/bevy_window/src/lib.rs @@ -102,7 +102,8 @@ impl Plugin for WindowPlugin { } if self.close_when_requested { - app.add_system(close_when_requested.in_base_set(CoreSet::PostUpdate)); + // Need to run before `exit_on_*` systems + app.add_system(close_when_requested); } // Register event types