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

Close window in order from newer one on macOS #10366

Merged
merged 1 commit into from Sep 12, 2017

Conversation

Projects
None yet
2 participants
@syohex
Contributor

syohex commented Aug 28, 2017

A parent window is not closed if a child modal window still exists on macOS.
So a child window should be closed before parent window closed.

Reproduce code

https://github.com/syohex/electron-app-quit-issue

npm install && npm run start

This example shows a window and show its child modal window. And then it calls app.quit() after three seconds. I expect that all windows are closed by app.quit() but parent window is not closed.

I checked this behavior by lldb. NSWindow#performClose does nothing(also delegate methods are not called) if child modal window still exists. Taking such behavior into consideration, a child window should be closed before parent window closed. (I could not find about this behavior from NSWindow document)

Gif animations

Original code(A parent window is not closed)

before

This version(Both parent and child windows are closed)

after

Close window in order from newer one on macOS
A parent window is not closed if a child modal window still exists.
So a child window should be closed before parent window closed.
@welcome

This comment has been minimized.

welcome bot commented Aug 28, 2017

💖 Thanks for opening this pull request! 💖

Here is a list of things that will help get it across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.
    We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.
@zcbenz

zcbenz approved these changes Sep 12, 2017

Looks good to me.

@zcbenz zcbenz merged commit 59cadf9 into electron:master Sep 12, 2017

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr AppVeyor build failed
Details
@welcome

This comment has been minimized.

welcome bot commented Sep 12, 2017

Congrats on merging your first pull request! 🎉🎉🎉

@syohex syohex deleted the syohex:window-close-order branch Sep 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment