Skip to content
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

prevent incorrect shifting of window when dragging onto monitor with different DPI #8

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

acarl005
Copy link
Collaborator

@acarl005 acarl005 commented Feb 7, 2025

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_CHANGED event. If that validation fails, it tried to move the window such that it will be on the monitor which triggered the WM_DPI_CHANGED event. 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

@acarl005 acarl005 requested a review from vorporeal February 7, 2025 23:00
@acarl005 acarl005 force-pushed the andy/fix-windows-dpi-changed-3 branch from a7340ba to fcfec57 Compare February 7, 2025 23:08
@@ -2441,7 +2383,7 @@ unsafe extern "system" fn thread_event_target_callback(
if userdata_removed {
drop(userdata);
} else {
Box::into_raw(userdata);
Box::leak(userdata);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to copy rust-windowing#3846 to make clippy happy.

Copy link

@vorporeal vorporeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looms look good so I'm stamping with minimal review. :)

@acarl005 acarl005 merged commit e1958d8 into warpdotdev/v0.30.x Feb 12, 2025
17 of 52 checks passed
acarl005 added a commit that referenced this pull request Feb 14, 2025
…anged-3"

This reverts commit e1958d8, reversing
changes made to fd5ff18.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants