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
getBounds() and setBounds() are inaccurate on scale factors above 100% #51730
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
42.2.0
What operating system(s) are you using?
Windows
Operating System Version
Windows 11 Pro 25H2
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
I haven't tested whether it worked in the past
Does the issue also appear in Chromium / Google Chrome?
I don't know how to test
Expected Behavior
At a 200% scale factor, if I run window.setBounds({ x: 200, y: 200, width: 400, height: 400 }), the window should take up the rectangle with the top left corner (400, 400) and the bottom right corner (1200, 1200).
Actual Behavior
The window takes up the rectangle with the top left corner (395, 400) and the bottom right corner (1205, 1205).
window.getBounds() reports { x: 200, y: 200, width: 400, height: 400 }, which matches the window.setBounds() call but not the actual size of the window.
@mitchchn reported here that he only sees the issue at scale factors above 100%. At 100%, everything seems to work fine. (I currently have no way to test at 100%.) This indicates the issue might come from rounding errors.
(This is not an issue I care deeply about. Just an issue I extracted from #51679.)
Activity
mitchchn commentedon May 21, 2026
@nikwen I also filed this one previously #51572.
nikwen commentedon May 22, 2026
Marking as duplicate upon @mitchchn's request.