Repository navigation
use unscaled mouse coordinates for convex hull test (#6332) - #6370
Merged
Merged
Conversation
|
Hi @singhashish-wpf. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge. To learn more about how to prepare a servicing PR click here. |
dreddy-work
reviewed
Apr 6, 2022
| // * the effect is transient - the tooltip will close when the user dismisses the popup | ||
| // * there's no accessibility issue - WCAG 2.1 only requires that the tooltip stays open under | ||
| // proscribed conditions, not that it has to close when the conditions cease to apply | ||
| System.Windows.Point ptScreen = PointUtil.ClientToScreen(pt, mouseSource); |
Member
There was a problem hiding this comment.
you may want to use direct mapping if it helps perf: ref:https://github.com/dotnet/winforms/blob/8b099dc847ccc153782b7c1591f677ff779ae9a8/src/System.Windows.Forms.Primitives/src/Interop/User32/Interop.MapWindowPoints.cs
dipeshmsft
approved these changes
Apr 8, 2022
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 #6220
Description
In high DPI environment, most tooltips opened by the mouse close immediately.
This is because the SafeArea uses unscaled coordinates, while the current mouse point uses scaled coordinates. In high DPI, these are different, leading to false negatives from the containment test "is the mouse within the SafeArea".
Fixed by using unscaled coordinates for the mouse point. (And incidentally improving the perf by avoiding a lot of unnecessary transformations into, and out of, scaled coordinates.)
Customer Impact
Make ToolTips great again (in high DPI).
Regression
Regression in PR #5931.
Testing
Tested by hand, but thoroughly, in .NET 4.8.1. The automated tests don't cover high DPI, unless you explicitly run them on a machine whose primary monitor is high DPI.
This is a straightforward port of the .NET Fx fix but should be tested in .NET Core anyway.
Risk
Low
Microsoft Reviewers: Open in CodeFlow