-
Notifications
You must be signed in to change notification settings - Fork 15k
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
[Bug]: Open BrowserWindow on secondary screen on MAc #42217
Comments
A better gist (to test on Fiddle for example): https://gist.github.com/NykoKar/002b79bdaed2bf36ab8f9bc30dbefec3 |
I'm sorry, I'm unable to reproduce this issue given the test case provided on macOS. I checked my display settings and the displays reported by Check out the Electron community. There are also a bunch of helpful people in this Discord that should be willing to point you in the right direction. For your question, I'd recommend the Discord - we have many active help channels and mentors, as well as fellow devs, who can help you out. |
@clavin I have two screens next to each other (main in front of me, secondary on my right) and the function screen.getAllDisplays() also give me the right values:
So the second monitor, which is the VG248, has
So, to create a BrowserWindow on this monitor, I put these parameters on the constructor (x & y + 50 as indicated on electron's documentation ): On my side, this BrowserWindow will be created on my primary screen whereas it should be displayed on my secondary as I have put coordinate of my secondary monitor. Additional information: I'm working on a mac mini. So, maybe there is a difference of behaviour between macbook with 1 external screen and mac mini with 2 external screens, just an idea. |
Preflight Checklist
Electron Version
30.0.6
What operating system are you using?
macOS
Operating System Version
MasOS Somona 14.4.1 - M1
What arch are you using?
Other (specify below)
Last Known Working Electron version
No response
Expected Behavior
Create a BrowserWindow on my secondary screen near main screen
Actual Behavior
The BrowserWindow is created on the main screen.
Testcase Gist URL
https://gist.github.com/NykoKar/f3f8e7eaec0e980d42d53c1b050e378b
Additional Information
I followed this documentation: https://www.electronjs.org/docs/latest/api/screen
It works on Windows but not on MacOS.
The text was updated successfully, but these errors were encountered: