prevent incorrect shifting of window when dragging onto monitor with different DPI#8
Merged
Conversation
a7340ba to
fcfec57
Compare
acarl005
commented
Feb 7, 2025
| drop(userdata); | ||
| } else { | ||
| Box::into_raw(userdata); | ||
| Box::leak(userdata); |
Collaborator
Author
There was a problem hiding this comment.
Needed to copy rust-windowing#3846 to make clippy happy.
vorporeal
approved these changes
Feb 8, 2025
vorporeal
left a comment
There was a problem hiding this comment.
Looms look good so I'm stamping with minimal review. :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes this issue: rust-windowing#4041 (comment)
The code I deleted has a validation to check if the new window bounds which Windows is suggesting to move the monitor to is actually on the monitor which triggered the
WM_DPI_CHANGEDevent. If that validation fails, it tried to move the window such that it will be on the monitor which triggered theWM_DPI_CHANGEDevent. However, this validation was buggy and was actually causing this bug. It was moving the window off of the intended monitor. It seems this is no longer necessary. For example, Chromium's DPI changed handler does not contain an analogous check.Hm... not sure why clippy is failing on code I haven't touched.. CI is all green on the PR against upstream which is based on upstream/master.
Before
https://www.loom.com/share/aefc5dc1027a42fc8f462c23621ce9a5
After
https://www.loom.com/share/81351dcb5938463c8bb60a66b2a0641b