Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cpn): Ignore 'Quit' event in main window on MacOS simulator running #2874

Merged
merged 1 commit into from
Dec 20, 2022

Conversation

philmoz
Copy link
Collaborator

@philmoz philmoz commented Dec 16, 2022

Prevents Companion app crashing on exit while the simulator is open.

In MacOS 10 the user cannot exit the app when the simulator window is open.
On MacOS 11, 12 and 13, the user can exit the app - from the Quit menu option or by pressing Command+Q.
However the app crashes while closing, prompting the user to send a bug report to apple.

This change stops the main window from closing, allowing the quit event to just close the simulator window.
Pressing Command+Q (or selecting Quit) a second time will close the Companion app.

I suspect there is a timing issue at play; but I have so far not been able to find it.
This change is probably not ideal; but I think is a reasonable work around for now.

Summary of changes:

Add a function to test if the simulator is running to helpers.cpp.
Ignore the quit event in MainWindow if the simulator is running.
The changes are limited to MacOS only.

Prevents app crashing on exit while the simulator is open.
@pfeerick pfeerick changed the title fix(cpn): Ignore 'Quit' event in main window on MacOS if the simulator is running. fix(cpn): Ignore 'Quit' event in main window on MacOS simulator running Dec 16, 2022
@pfeerick pfeerick added bug 🪲 Something isn't working companion Related to the companion software labels Dec 16, 2022
@pfeerick pfeerick modified the milestones: 2.9, 2.8.1 Dec 20, 2022
@pfeerick pfeerick merged commit af040c9 into EdgeTX:main Dec 20, 2022
mha1 pushed a commit to mha1/edgetx that referenced this pull request Dec 22, 2022
…nning (EdgeTX#2874)

Prevents app crashing on exit while the simulator is open.
pfeerick pushed a commit that referenced this pull request Dec 23, 2022
…nning (#2874)

Prevents app crashing on exit while the simulator is open.
@philmoz philmoz deleted the macos-close-behaviour branch September 20, 2023 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working companion Related to the companion software
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants