bevyengine / bevyengine/bevy

CMD + Q does not behave the same as closing the window with the X button (macOS)

Open
#20,316 2 comments 0 reactions 0 assignees View on GitHub
A-Windowing C-Bug O-MacOS S-Needs-Investigation S-Needs-Testing
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## Bevy version

0.16

## What you did

I noticed that closing the application by clicking the "X" button will correctly terminate it and my autosave_on_exit function is called:
```rust
.add_systems(Last, autosave_on_exit)
```

## What went wrong

but when i do "CMD+Q" it will just kill the application (no errors) and the `autosave_on_exit` is never called.

I would expect the same behavior for "CMD+Q" as for closing the window/application.

## Additional information

Tested on macOS.

Created a new issue as requested in #17307

Contributor guide

Open the contributing guide

Research direction

Start from the reported autosave_on_exit system registered in Last and inspect Bevy's macOS window and application-close handling. Reproduce CMD+Q versus clicking the window close control on macOS, then verify that autosave_on_exit runs for both paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.