electron: [Bug]: Child window disappears after moving it to another monitor (macOS Monterey)

Preflight Checklist

Electron Version

~15.3.1~ 21-x-y

What operating system are you using?

macOS

Operating System Version

macOS Monterey 12.0.1

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

When moving a child window to another monitor on macOS Monterey 12.0.1, I expect the child window to stay visible.

const mainWindow = new BrowserWindow({
    // ...
});
mainWindow.webContents.loadFile('main.html');

const childWindow = new BrowserWindow({
    // ...
    parent: mainWindow
});
childWindow.webContents.loadFile('child.html');

Actual Behavior

However, since I upgraded macOS from Big Sur 11 to Monterey 12, the child window just disappears when moving it to another window.

If I remove the parent: mainWindow from the code that creates the child window, everything works fine.

It happens when creating the child window in the main process as well as in the renderer process.

Testcase Gist URL

No response

Additional Information

No response

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

I just tested my fiddle on Electron 21 and it is still an issue! 😢