Update application exit logic #405
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On macos, applications using ElectronNET.API were not exiting properly. Specifically, there are two issues contributing to this, both of which are discussed in #346.
The all windows closed event was not firing for macos. This meant that the application developer was not able to automatically close the application when all windows were closed and running on macos.
Depending on how the application was triggered to close, the .NET Core kestrel process was not automatically exiting.
This PR fixes both of these issues. A larger issue, though, is that application behavior for macos is being fixed in the electron main process. It may make sense to make a larger change in which all of the behavior is handled in the Electron.API and consuming application, thus giving the end user complete control over the behavior without introducing inconsistent behavior between platforms. For example, rather than then current logic checking the platform in the electron main process, the ElectronNET.API could check and automatically set the default of
Electron.WindowManager.IsQuitOnWindowAllClosedon macos to false. That would eliminate custom logic in the electron main process and keeps behavior consistent.Since this issue is impacting myself and others, I propose to merge this current change and make the additional change at a later time if deemed appropriate.
Fixes #346