-
Notifications
You must be signed in to change notification settings - Fork 36
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: adjust window position for monitor DPI #119
Conversation
Seems to work correctly if size/position is set twice: #[cfg(target_os = "windows")]
{
let _ = window.set_size(size);
let _ = window.set_position(position);
let _ = window.set_size(size);
let _ = window.set_position(position); // < not sure whether this call is necessary or if it's only size that needs to be set twice
} We do something similar in GlazeWM where we call Are you able to reproduce #116 btw? Wonder if this also fixes that issue |
After some testing, I was able to reproduce #116. With the adjustments of this PR, the problem no longer occurred (with and without calling |
I was unable to reproduce any problems that require to set size and position twice. |
Never mind, I was able to reproduce the same problem you mentioned. |
Ay that's great 🙌 BTW, I think we should be scaling only pixel values and leaving % values (e.g. |
Makes sense, I hadn't thought of that. I will make the change. |
Percentage values are no longer scaled. |
🎉 This PR is included in version 2.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
anchor_<x|y>
(line 246) is already a PhysicalPositionExample:
Monitor: 1600px 900px with 150%
Before the y-position was calculated by
(1600+-24)*(2/3)
and not by1600+(-24*(3/2))
.I think that #115 might be related to this.