electron
electron copied to clipboard
[Bug]: Child window disappears after moving it to another monitor (macOS Monterey)
Preflight Checklist
- [X] I have read the Contributing Guidelines for this project.
- [X] I agree to follow the Code of Conduct that this project adheres to.
- [X] I have searched the issue tracker for a feature request that matches the one I want to file, without success.
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
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?
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.
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
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.
I created a fiddle to showcase this bug: https://gist.github.com/3c890ee2fd57cf8c87da11d2ae7fdb24
Confirmed that it affects electron 17.0.0.
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 just tested my fiddle on Electron 21 and it is still an issue! 😢
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 v22.0.1 and the issue is still there. 😢
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. I just tested my fiddle with electron v24.1.1 and the bug is still there. :(
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. I just tested my fiddle with electron v25.3.0 and the bug is still there. :(
Bump. Electron v26.2.0 still an issue.
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.
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!
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.