electron icon indicating copy to clipboard operation
electron copied to clipboard

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

Open hkors opened this issue 4 years ago • 18 comments
trafficstars

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

hkors avatar Nov 14 '21 18:11 hkors

Hey @hkors,

Just to make sure I'm reading the bug report correctly -- the same code, with the same Electron version, works on Big Sur 11 but not on Monterey 12, correct? The only change is the different macOS version?

ckerr avatar Nov 16 '21 18:11 ckerr

Hey @hkors,

Just to make sure I'm reading the bug report correctly -- the same code, with the same Electron version, works on Big Sur 11 but not on Monterey 12, correct? The only change is the different macOS version?

Hi @ckerr,

Yes that is correct. Since I upgraded my macOS version from 11 to 12, any child window (with the parent property set) magically disappears if you drag it to another monitor. No code changes.

It also happened with Electron version 11.1.0. I hoped this issue would go away after upgrading to Electron 15.3.1 but unfortunately the bug is still there.

hkors avatar Nov 16 '21 18:11 hkors

I can confirm that the child window, when moved to the secondary monitor disappears on all stable releases till v3. electron v2 and downwards, I need to confirm as it requires a code change

bavulapati avatar Jan 19 '22 11:01 bavulapati

Thanks for reporting this and helping to make Electron better!

Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

I'm adding the blocked/need-repro label for this reason. After you make a test case, please link to it in a followup comment.

Thanks in advance! Your help is appreciated.

nornagon avatar Jan 19 '22 18:01 nornagon

I created a fiddle to showcase this bug: https://gist.github.com/3c890ee2fd57cf8c87da11d2ae7fdb24

Confirmed that it affects electron 17.0.0.

stefansundin avatar Feb 01 '22 23:02 stefansundin

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

github-actions[bot] avatar Oct 05 '22 02:10 github-actions[bot]

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

stefansundin avatar Oct 05 '22 03:10 stefansundin

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

github-actions[bot] avatar Jan 11 '23 02:01 github-actions[bot]

BUMP. Just tested my fiddle on Electron v22.0.1 and the issue is still there. 😢

stefansundin avatar Jan 11 '23 05:01 stefansundin

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

github-actions[bot] avatar Apr 13 '23 01:04 github-actions[bot]

Bump. I just tested my fiddle with electron v24.1.1 and the bug is still there. :(

stefansundin avatar Apr 14 '23 17:04 stefansundin

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

github-actions[bot] avatar Jul 14 '23 02:07 github-actions[bot]

Bump. I just tested my fiddle with electron v25.3.0 and the bug is still there. :(

stefansundin avatar Jul 16 '23 03:07 stefansundin

Bump. Electron v26.2.0 still an issue.

danilo-timacum avatar Sep 12 '23 08:09 danilo-timacum

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

Bump. Just tested my fiddle on electron 28.0.0 and the bug is still there.

stefansundin avatar Dec 13 '23 17:12 stefansundin

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

I have stopped caring about this so I am going to stop bumping it. Unsubscribed.

Yes, I realize this comment will bump it, but if someone else wants to take over the bumping duty in the future then feel free!

Bye!

stefansundin avatar Mar 15 '24 02:03 stefansundin

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.