New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: window bounds not scaled from screen coordinates #29162
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes look good to me, amazing catch, Sam! 👏 👏
Release Notes Persisted
|
I have automatically backported this PR to "11-x-y", please check out #29225 |
I have automatically backported this PR to "12-x-y", please check out #29226 |
I have automatically backported this PR to "13-x-y", please check out #29227 |
Description of Change
fixed #25811
possibly related to #25420 #21777
On Windows, the
will-resize
andwill-move
events emit the pending bounds of the window. However, they're reported in screen coordinates which aren't scaled according to the display scale factor.Here's a clip of a window being moved between a 4k and 1080p monitor which causes its scale factor to change. The width/height of
newBounds
remains the same with this fix.(as an aside, there seems to be an unrelated rounding bug with the width/height of
currentBounds
you can also see)2021-05-13_20-13-01.mp4
No tests are included as I'm not sure whether we have a way to test display scale changes.
Checklist
npm test
passesRelease Notes
Notes: Fixed
will-resize
andwill-move
events not scaling the emittednewBounds
rectangle to the appropriate Windows display scale factor.