Fix issue 14449: ToolStrip DPI change issue in .NET 10#14454
Fix issue 14449: ToolStrip DPI change issue in .NET 10#14454SimonZhao888 wants to merge 3 commits intodotnet:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to fix a .NET 10 regression where ToolStrip DPI change handling uses an incorrect “old DPI” value by adjusting how Control.OriginalDeviceDpiInternal is retrieved.
Changes:
- Updated
Control.OriginalDeviceDpiInternalgetter logic in an attempt to prevent it from incorrectly returningDeviceDpiInternalwhen computing the old DPI.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @SimonZhao888, thanks for the fix! I've reviewed the changes and have a few observations: 1. The fix correctly addresses the root cause ✅
In the original code, after 2. Consider adding a code comment for the first assignment (line 11566) 3. Broader test coverage 4. Automated regression test |
Fixes #14449
When we drag the ToolStrip control on screens with different DPI settings, the call stack history is WmDpiChangedBeforeParent -> RescaleConstantsForDpi. However, within the WmDpiChangedBeforeParent method, OriginalDeviceDpiInternal and DeviceDpiInternal retrieve the same value, which will cause the RescaleConstantsForDpi method in the ToolStrip class to fail to execute as expected.
Proposed changes
Customer Impact
Regression?
Risk
-Minimal
Screenshots
Before
After
Test methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow