electron-api-demos icon indicating copy to clipboard operation
electron-api-demos copied to clipboard

wrong screen information in 4K screen

Open rainonline opened this issue 7 years ago • 3 comments

  • What operating system are you using?
  • What version of Node.js is on your system? snipaste_2017-11-21_00-58-32 snipaste_2017-11-21_00-58-56 snipaste_2017-11-21_01-00-45

rainonline avatar Nov 20 '17 17:11 rainonline

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.

winstliu avatar Nov 20 '17 17:11 winstliu

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!

mokhosh avatar Apr 10 '18 20:04 mokhosh

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
})

image

ArthurMao avatar Dec 30 '18 21:12 ArthurMao