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

core: fix closing confirmation on Electron #8861

Merged
merged 1 commit into from
Dec 15, 2020

Conversation

paul-marechal
Copy link
Member

On Electron/Linux, doing showMessageBoxSync does not block the
unloading process. This leads to the window closing despite the user
asking to keep it open.

Instead we'll prevent closing right way, ask for confirmation and
finally close.

Signed-off-by: Paul Maréchal [email protected]

Closes #8186

How to test

  • Build and run the Electron example app on Linux.
  • Set the core.confirmExit preference on always.
  • Close the window and click on no.
  • The window should stay open, and you should be able to repeat those steps again.

Review checklist

Reminder for reviewers

@paul-marechal paul-marechal added bug bugs found in the application electron issues related to the electron target OS/Linux issues related to the Linux OS labels Dec 14, 2020
@paul-marechal paul-marechal force-pushed the mp/electron-confirm-close branch from d402e40 to 6db76ec Compare December 14, 2020 18:29
On Electron/Linux, doing `showMessageBoxSync` does not block the
unloading process. This leads to the window closing despite the user
asking to keep it open.

Instead we'll prevent closing right way, ask for confirmation and
finally close.

Signed-off-by: Paul Maréchal <[email protected]>
@paul-marechal paul-marechal force-pushed the mp/electron-confirm-close branch from 6db76ec to 4d366e6 Compare December 14, 2020 18:31
@paul-marechal paul-marechal force-pushed the mp/electron-confirm-close branch from ff35622 to 4d366e6 Compare December 14, 2020 20:45
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes work very well and it now respects the end-user's choice when attempting to close the application. I verified for both linux and macos, that the application:

  • the application closes successfully when the user chooses yes to quit.
  • the application remains open when the user chooses no.

@paul-marechal paul-marechal merged commit 5511152 into master Dec 15, 2020
@paul-marechal paul-marechal deleted the mp/electron-confirm-close branch December 15, 2020 22:13
@github-actions github-actions bot added this to the 1.9.0 milestone Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application electron issues related to the electron target OS/Linux issues related to the Linux OS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[electron] Backend processes are already terminated before 'will-prevent-unload' is called
3 participants