Skip to content

Conversation

@singhashish-wpf
Copy link
Contributor

@singhashish-wpf singhashish-wpf commented Apr 6, 2022

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

@singhashish-wpf singhashish-wpf requested a review from a team as a code owner April 6, 2022 04:01
@ghost ghost assigned singhashish-wpf Apr 6, 2022
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Apr 6, 2022
@ghost ghost requested review from SamBent and dipeshmsft April 6, 2022 04:01
@singhashish-wpf singhashish-wpf changed the title use unscaled mouse coordintes for convex hull test (#6332) use unscaled mouse coordinates for convex hull test (#6332) Apr 6, 2022
@ghost
Copy link

ghost commented Apr 6, 2022

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.

@singhashish-wpf singhashish-wpf added this to the .NET 6.0 Servicing milestone 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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@singhashish-wpf singhashish-wpf merged commit 1de1b78 into release/6.0 Apr 8, 2022
@singhashish-wpf singhashish-wpf deleted the tooltipregress branch April 8, 2022 05:18
@ghost ghost locked as resolved and limited conversation to collaborators May 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

PR metadata: Label to tag PRs, to facilitate with triage Servicing-approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants