electron-api-demos
electron-api-demos copied to clipboard
wrong screen information in 4K screen
- What operating system are you using?
- What version of Node.js is on your system?

I can confirm this. I am running at 1920x1080 resolution at 150% DPI but size only reports 1280x720. Looks like it's not being multiplied by scaleFactor.
same here. i'm running on 4k and it says you're screen is 1536px x 864px. i'm a bit offended to be honest. at least give me 1080p!
const { screen } = require('electron')
const screenInfoBtn = document.getElementById('screen-info')
const screenInfo = screen.getPrimaryDisplay();
screenInfoBtn.addEventListener('click', () => {
const message = `Your screen is: ${screenInfo.size.width*screenInfo.scaleFactor}px x ${screenInfo.size.height*screenInfo.scaleFactor}px`
document.getElementById('got-screen-info').innerHTML = message
})
