bevy/crates/bevy_winit/src
aloucks 19ee692f96
Prevent an additional world update after all windows have closed on Windows (#18175)
# Objective

The fix in #18105 includes a check for running headless, but this allows
for an extra world update during shutdown.

This commit checks if the `AppExit` event has been recorded and prevents
the additional world update.

### Before

```
2025-03-06T03:11:59.999679Z  INFO bevy_window::system: No windows are open, exiting    
2025-03-06T03:12:00.001942Z  INFO bevy_winit::system: Closing window 0v1
2025-03-06T03:12:00.012691Z  INFO bevy_window::system: No windows are open, exiting
```
### After

```
2025-03-06T03:18:45.552243Z  INFO bevy_window::system: No windows are open, exiting    
2025-03-06T03:18:45.554119Z  INFO bevy_winit::system: Closing window 0v1
```
## Testing

Ran `window` examples

- `monitor_info` continues to run after all windows are closed (it has
`ExitCondition::DontExit`)
- `window_settings` invisible window creation works as expected
- `multiple_windows` exits after both windows are closed with a single
exit message
2025-03-06 21:13:18 +00:00
..
accessibility.rs Make Query::single (and friends) return a Result (#18082) 2025-03-02 19:51:56 +00:00
converters.rs Expose text field from winit in KeyboardInput (#16864) 2024-12-17 22:42:54 +00:00
cursor.rs Automatically transform cursor hotspot user asks to flip cursor image (#17540) 2025-01-28 05:49:46 +00:00
custom_cursor.rs Allowed creating uninitialized images (for use as storage textures) (#17760) 2025-02-10 22:22:07 +00:00
lib.rs Replace some !Send resources with thread_local! (#17730) 2025-03-04 07:48:02 +00:00
state.rs Prevent an additional world update after all windows have closed on Windows (#18175) 2025-03-06 21:13:18 +00:00
system.rs Renamed EventWriter::send methods to write. (#17977) 2025-02-23 21:18:52 +00:00
winit_config.rs Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
winit_monitors.rs Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
winit_windows.rs Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00