Skip to content

Conversation

@Wartori54
Copy link
Contributor

@Wartori54 Wartori54 commented Jun 23, 2025

Docs here specify that after a terminate call the process stops entirely, and since the MacOS gui returns true here

fn should_terminate_after_last_window_closed(&self) -> bool { true }

the app simply stops entirely after the window.close() call. This PR fixes this, changing the above to false and calling stop right after the window is closed. This way the app.run() call stops blocking and the program can continue as normal. The call to stop had to be done manually since Cacao does not implement such functionality, and after it I also encountered some buggy behavior relating to a NSAutoReleasePool. See comments for the details.
There probably is a better way to have app not drop its pool, I'm widely open to suggestions.
Some of the copied code add tons of warnings to the build process (such as the msg_send macros), I do not know how fixable is this, in case it is, since it seems an issue on objc's side.

I do not know why this ever worked, but all MacOS users got affected by this issue with the .NET 8 migration of Everest.

@Wartori54 Wartori54 changed the title Fix app exiting after macos gui exists Fix app exiting after macos gui exits Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant