You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
min-width and max-width broken on hi-dpi screens #2714
This is a Windows issue.
Tested on Windows 10 using a retina Macbook, Electron 0.31.1
With a hi-dpi screen the min-width and max-widthattributes are interpreted as double size, so if I set a min-width of 500px on the browser-window it will actually enforce a min-width of 1000px. Same applies for height.
Obviously because customers will have a mixture of screen DPI's (increasingly hi-dpi) this means that the min and max options can't be used at all as they stretch the app out on the hires screens.
Do you mean that the min-width and min-height are doubled, but the width and height are not?
If all of them are doubled, the behavior you're describing sounds reasonable. An app designed on a 1920x1080 (FHD) screen, should have twice the width and height when running on a 3840x2160 (4K) screen of a similar size (the minimum and maximum of each dimension should be doubled as well).
In any case did you try using webFrame.setZoomFactor(factor)? Some users used it to implement HiDPI support on Linux, so I guess you might be able to use it in order to disable it.
You're correct in that min-width and min-height are doubled but the width and height are NOT. If I remove the min/max attributes then the window is correctly sized.
It's not the content that's zoomed, it's the browser window itself that is sized too large - the content rendering appears correct and crisp at the HiDPI (awesome).
Something I brought up in #1806: on scaled desktops, window.outerHeight / outerWidth are set incorrectly. They appear to be scaled down based on the windows desktop scale ratio. So if you have desktop scaling set to 200%, a window 800px wide will have a outerWidth of 400. This might be related to this issue.
Activity
etiktin commentedon Sep 5, 2015
Do you mean that the
min-widthandmin-heightare doubled, but thewidthandheightare not?If all of them are doubled, the behavior you're describing sounds reasonable. An app designed on a 1920x1080 (FHD) screen, should have twice the width and height when running on a 3840x2160 (4K) screen of a similar size (the minimum and maximum of each dimension should be doubled as well).
In any case did you try using
webFrame.setZoomFactor(factor)? Some users used it to implement HiDPI support on Linux, so I guess you might be able to use it in order to disable it.tommoor commentedon Sep 5, 2015
You're correct in that
min-widthandmin-heightare doubled but thewidthandheightare NOT. If I remove the min/max attributes then the window is correctly sized.It's not the content that's zoomed, it's the browser window itself that is sized too large - the content rendering appears correct and crisp at the HiDPI (awesome).
ToadKing commentedon Sep 6, 2015
Something I brought up in #1806: on scaled desktops, window.outerHeight / outerWidth are set incorrectly. They appear to be scaled down based on the windows desktop scale ratio. So if you have desktop scaling set to 200%, a window 800px wide will have a outerWidth of 400. This might be related to this issue.
zcbenz commentedon Sep 7, 2015
I'm merging this to #1806.