Repository navigation
Fix Popup regression on high DPI - #6300
ThomasGoulet73 wants to merge 1 commit into
Conversation
|
@dotnet/wpf-developers Could this PR be prioritized ? This fixes a regression introduced in .Net 6.0.3 which broke most popups on screens with high DPI. Hopefully this could get backported to the release/6.0 branch and included in .Net 6.0.4 (If this PR is considered to be the right fix and accepted by the WPF team, obviously). Thank you! |
|
@ThomasGoulet73 - I'm preparing a better fix in .NET Framework, which we'll port to .NET Core when it's ready (probably this week). I started out doing something similar to yours, but discovered it had numerical instability and performance issues, both arising from the many layers of transforms involved. Fortunately, there's a way to avoid all that. We should have announced that we were working on this, to save you some trouble. Sorry about that. BTW, your diagnosis is backwards - the points in the convex hull use a physical pixel coordinate system (i.e. not DPI-aware), whereas the mouse point uses logical pixels (i.e. DPI-aware). Or maybe we just differ in what "DPI-aware" means. Not a big deal - the important thing is that they use different coordinate systems when scaling is > 100%, and that's what causes the bug. |
That's great, I'm looking forward to see what the right fix is. I didn't notice "numerical instability and performance issues" but this might be because I only did manual testing for this PR.
No worries. But yes, in the future, a quick "We're working on this" would be nice to avoid having the WPF team and people from the community work on the same thing at the same time.
That makes sense. We have the same meaning of "DPI-aware", I just thought that the convex hull was dpi scaled and the mouse was not dpi scaled. Thank you for the explanation! Closing this PR since it's being worked on by the WPF team. |
Fixes #6289
Description
Fixes a regression where popups would vanish when using high DPI settings. The current code in .Net 6.0.3 uses the position of the mouse to check if the mouse was inside an array of points. The problem was that the position of the mouse was not DPI aware while the array of points was DPI aware. I fixed this by transforming the position of the mouse to have a point which is DPI aware.
Customer Impact
Fixes popup vanishing immediately.
Regression
Regression introduced in .Net 6.0.3 with #6063 which was a backport of #5931.
Testing
I tested locally using the sample provided here: #6063 (comment). I used two monitors with different DPI settings and after the changes in this PR, the issue was fixed.
Risk
Low.