Fix runaway resizing during mixed-DPI window drags - #4694
Open
LunaticGhoulPiano wants to merge 1 commit into
Open
LunaticGhoulPiano wants to merge 1 commit into
LunaticGhoulPiano wants to merge 1 commit into
Conversation
Use the WM_DPICHANGED suggested rectangle while a window is being dragged. This prevents conservative DPI adjustment from moving the window back to the previous monitor and triggering repeated growth.
Author
|
The CI failures appear unrelated to this PR. All affected jobs fail during the shared The workflow currently runs: cargo update -p syn --precise 2.0.114I reproduced the failure locally. Qualifying the package by major version works: cargo update -p syn@2 --precise 2.0.114 |
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.
Fixes #4600.
Problem
On Windows 11 24H2 with mixed-DPI monitors, dragging a maximized window from a 125% scaled monitor to a 100% scaled monitor can repeatedly enlarge the restored window and keep it attached to the original monitor.
The conservative rectangle adjustment performed during
WM_DPICHANGEDcan move the window back to the previous monitor, causing another DPI transition and creating a resize feedback loop.Fix
While the window is inside a live move/resize operation, apply the rectangle suggested by
WM_DPICHANGEDdirectly.Outside a live move/resize operation, retain the existing conservative DPI adjustment and monitor-nudge behavior.
Testing
cargo +nightly fmt --all -- --checkcargo check --libTested by repeatedly dragging a winit application between monitors with different DPI scale factors
Verified with TS Analyzer through
eframeConfirmed that the window moves to the target monitor without uncontrolled growth
Tested on all platforms changed
Added an entry to the
changelogmoduleDocumentation changes are not applicable
No example changes are required
No feature-matrix changes are required