-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Encapsulate Electron Window Logic - Allow Exit during Load #10600
Conversation
a904f2a
to
b837b7d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong pull-request :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes are looking really good to me! After applying the fix from #10597 I was able to successfully execute all testing steps:
- Shutting off the application before it reaches its
ready
state is possible - Different configurations of the
application.confirmOnExit
preference, dirty editors, etc. work correctly when trying to exit the application - Commands such as
Configure Display Language
orReset Workbench Layout
still ask for confirmation for a reload - Switching between different
window.titleBarStyle
on different windows and reloading the windows continues to work correctly
b837b7d
to
4783f01
Compare
Thanks, @msujew. I'll merge this after the release. |
7e47f0c
to
ed87621
Compare
- Extracts logic for handling various window events from the ElectronMainApplication class into a TheiaElectronWindow wrapper class - Adds communication about application state between window and the TheiaElectronWindow
ed87621
to
5b03793
Compare
…bugfix/permit-close-before-load
…bugfix/permit-close-before-load
870b600
to
95875fc
Compare
…bugfix/permit-close-before-load
…heia#10600) - Extracts logic for handling various window events from the ElectronMainApplication class into a TheiaElectronWindow wrapper class - Adds communication about application state between window and the TheiaElectronWindow
What it does
Fixes #10586
This PR is a pretty big intervention into the logic of the ElectronMainApplication. The narrow goal is to track whether a window on the frontend is in a state to handle a close request so that windows that aren't ready to handle the close request can be closed immediately. The larger goal is to begin to extract the logic of handling Theia windows so that we can develop an abstraction that will work for both Electron and browser with an eye to doing things like running cleanup when the last window is closed. There are much smaller interventions that can address the narrow goal, so if there isn't an appetite for this size of refactor, that's fine, and I'm happy to reduce it to the minimum necessary to ensure that close gets handled correctly.
How to test
ready
state.window.titleBarStyle
(if not on Mac) preference and observe that the application restarts correctly.Review checklist
Reminder for reviewers