prevent incorrect resizing/shifting of window when dragging onto monitor with different DPI#4341
Merged
Conversation
4 tasks
kchibisov
requested changes
Aug 24, 2025
For earlier Windows 10 builds (pre-22000), a workaround was necessary to fix dragging window onto a monitor with different DPI. This commit makes the old DPI workaround only applied conditionally. Applying it globally on newer systems breaks DPI switching.
kchibisov
approved these changes
Aug 24, 2025
|
Glad this got merged! Any rough estimate on when we'll get an updated |
danielpancake
added a commit
to danielpancake/winit
that referenced
this pull request
Mar 21, 2026
Backport of PR rust-windowing#4341 to 0.30.x: make the conservative-rect + monitor-nudging logic conditional on Windows 10 (build < 22000). On Windows 11+, use the OS-provided suggested_rect directly, avoiding the cascading WM_DPICHANGED feedback loop that causes the window to grow indefinitely. Fixes rust-windowing#4041
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.
changelogmodule if knowledge of this change could be valuable to usersUpdated documentation to reflect any user-facing changes, including notes of platform-specific behaviorCreated or updated an example program if it would help users understand this functionalityThe original PR 4119 appears to be abandoned. This PR aims to recreate the fix, following the project guidelines.