Skip to content

Commit

Permalink
Fix closing window does not exit app in desktop_app mode (#7628)
Browse files Browse the repository at this point in the history
# 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](#7624 (comment)).
  • Loading branch information
akimakinai committed Feb 13, 2023
1 parent 68c94c0 commit bf514ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/bevy_window/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bf514ff

Please sign in to comment.