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

Add support for child windows #6140

merged 23 commits into from Jun 20, 2016


None yet
1 participant

zcbenz commented Jun 20, 2016


This is still under testing, each platform has huge differences on how the child windows should work, I'm trying to figure out a way to make the API work consistently on all platforms without platform-dependent code.

Close #323.


Parent and child windows

By using parent option, you can create child windows:

let top = new BrowserWindow()
let child = new BrowserWindow({parent: top})

The child window will always show on top of the top window.

Modal windows

A modal window is a child window that disables parent window, to create a modal
window, you have to set both parent and modal options:

let child = new BrowserWindow({parent: top, modal: true, show: false})
child.once('ready-to-show', () => {

Platform notices

  • On macOS the child windows will keep the relative position to parent window
    when parent window moves, while on Windows and Linux child windows will not
  • On Windows it is not supported to change parent window dynamically.
  • On Linux the type of modal windows will be changed to dialog.
  • On Linux many desktop environments do not support hiding a modal window.

@zcbenz zcbenz merged commit 3428874 into master Jun 20, 2016

7 of 8 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
electron-linux-arm Build #3477575 succeeded in 39s
electron-linux-ia32 Build #3477576 succeeded in 33s
electron-linux-x64 Build #3477577 succeeded in 124s
electron-mas-x64 Build #1611 succeeded in 6 min 43 sec
electron-osx-x64 Build #1616 succeeded in 6 min 14 sec
electron-win-ia32 Build #613 succeeded in 6 min 21 sec
electron-win-x64 Build #607 succeeded in 6 min 29 sec

@zcbenz zcbenz deleted the parent branch Jun 20, 2016

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