Comments (3)
@clavin
Thank you for your feedback but I'm not sure you understand my issue (because I really think there is one) so I'll try to explain it better.
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:
[
{
id: 2,
label: 'DELL U2720Q',
bounds: { x: 0, y: 0, width: 3008, height: 1692 },
workArea: { x: 0, y: 25, width: 3008, height: 1667 },
accelerometerSupport: 'unknown',
monochrome: false,
colorDepth: 24,
colorSpace: '{primaries:BT709, transfer:SRGB, matrix:RGB, range:FULL}',
depthPerComponent: 8,
size: { width: 3008, height: 1692 },
displayFrequency: 59,
workAreaSize: { width: 3008, height: 1667 },
scaleFactor: 2,
rotation: 0,
internal: false,
touchSupport: 'unknown'
},
{
id: 1,
label: 'VG248',
bounds: { x: 3008, y: 0, width: 1920, height: 1080 },
workArea: { x: 3008, y: 25, width: 1920, height: 1055 },
accelerometerSupport: 'unknown',
monochrome: false,
colorDepth: 24,
colorSpace: '{r:[0.6502, 0.3292], g:[0.3301, 0.6229], b:[0.1513, 0.3292], w:[0.3127, 0.3290]}, transfer:BT709_APPLE, matrix:RGB, range:FULL}',
depthPerComponent: 8,
size: { width: 1920, height: 1080 },
displayFrequency: 60,
workAreaSize: { width: 1920, height: 1055 },
scaleFactor: 1,
rotation: 0,
internal: false,
touchSupport: 'unknown'
}
]
So the second monitor, which is the VG248, has
bounds: { x: 3008, y: 0, width: 1920, height: 1080 },
So, to create a BrowserWindow on this monitor, I put these parameters on the constructor (x & y + 50 as indicated on electron's documentation ):
new BrowserWindow({ x: 3008 + 50, y: 0 + 50, })
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.
from electron.
A better gist (to test on Fiddle for example): https://gist.github.com/NykoKar/002b79bdaed2bf36ab8f9bc30dbefec3
from electron.
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 screen.getAllDisplays()
and everything seems to be working properly.
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.
from electron.
Related Issues (20)
- Is there anyone who have solved this issue ?
- [Bug]: notification-spec link is broken in the notifications.md file
- [Bug]: Electron .pkg throwing JS error when installed through TEST FLIGHT HOT 1
- [Bug]: Electron net.fetch can't handle non-ASCII characters in headers
- [Bug]: Windows 7 BrowserWindow setting transparent background is invalid HOT 1
- [Bug]: Electron not sending cookies with request HOT 3
- [Bug]: `WebviewTag.webpreferences` has wrong type
- [Bug]: GNU/Linux/Fedora/KDE: file selection dialog doesn't work HOT 3
- [Bug]: `showItemInFolder` opens up to parent directory when file at path does exist for Electron snap
- [Bug]: Custom Drag and Drop broken on Electron 28 and later
- [Bug]: BrowserWindow.setSize() does not size down when resizable=false HOT 1
- [Bug]: app not loading HOT 2
- [Bug]: backgroundThrottling does not work for BrowserView on MacOS HOT 3
- [Bug]: Electron 30 Menu in toolbar - font has changed from v29. HOT 1
- [Bug]: Can't set menu prop "visible" on separator! HOT 1
- [Bug]: App Cresh call func from Dll HOT 1
- [Bug]: Running electron dev from wsl as explained by the docs leads to crash / white screen HOT 2
- [Bug]: BrowserWindow.show does not show the window as expected
- [Bug]: require('fs') return undefined HOT 1
- [Bug]: Electron crashed after calling AudioContext:decodeAudioData() when contextIsolation is true HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from electron.