bevy/crates/bevy_window/src
François 07d576987a fix order of exit/close window systems (#5558)
# Objective

Fixes #5384 and maybe other issues around window closing/app not exiting

## Solution

There are three systems involved in exiting when closing a window:
- `close_when_requested` asking Winit to close the window in stage `Update`
- `exit_on_all_closed` exiting when no window remains opened in stage `Update`
- `change_window` removing windows that are closed in stage `PostUpdate`

This ordering meant that when closing a window, we had to run one more frame to actually exit. As there was no window, panics could occur in systems assuming there was a window. In case of Bevy app using a low power options, that means waiting for the timeout before actually exiting the app (60 seconds by default)

This PR changes the ordering so that `exit_on_all_closed` happens after `change_window` in the same frame, so there isn't an extra frame without window
2022-08-03 20:03:34 +00:00
..
cursor.rs Fix various typos (#5417) 2022-07-21 20:46:54 +00:00
event.rs Update MouseMotion and CursorMoved docs (#5090) 2022-06-26 13:40:43 +00:00
lib.rs fix order of exit/close window systems (#5558) 2022-08-03 20:03:34 +00:00
raw_window_handle.rs add more SAFETY comments and lint for missing ones in bevy_ecs (#4835) 2022-07-04 14:44:24 +00:00
system.rs Allow closing windows at runtime (#3575) 2022-05-05 13:35:43 +00:00
window.rs bevy_reflect: Reflect enums (#4761) 2022-08-02 22:14:41 +00:00
windows.rs Add documentation comments to bevy_window (#4333) 2022-06-16 13:20:37 +00:00