Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToolTips in popups (or any context where capture is active) (#5931) #6063

Merged
merged 3 commits into from Feb 7, 2022
Merged

ToolTips in popups (or any context where capture is active) (#5931) #6063

merged 3 commits into from Feb 7, 2022

Conversation

singhashish-wpf
Copy link
Member

Fixes #5716

Description

The new 6.0 tooltip behavior computes a "safe area" in which the user can move the mouse without dismissing the tooltip. It's computed with coordinates relative to the owner's PresentationSource (hwnd), but the mouse movements were tracked relative to the input provider's PresentationSource. These are often the same, but not when the tooltip's owner comes from a Popup (or similar context that captures mouse input away from the normal input provider). This dismisses the tooltip immediately - the logic thinks the mouse has left the safe area.

Fixed by converting the mouse position to the correct coordinate system - relative to the tooltip owner's PresentationSource.

Customer Impact

Fixes a regression.

Regression

Yes.

Testing

Risk

Low. Applies the correct coordinate transformation before checking the mouse position.

* make SafeArea check work when capture is active

* Update and sync changes with main and #5932

Co-authored-by: Ashish Kumar Singh <SINGHASHISH@MICROSOFT.COM>
@singhashish-wpf singhashish-wpf requested a review from a team as a code owner February 3, 2022 10:56
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Feb 3, 2022
@ghost ghost requested review from fabiant3, ryalanms and SamBent February 3, 2022 10:56
@leecow leecow added this to the 6.0.3 milestone Feb 3, 2022
@gmanny
Copy link

gmanny commented Feb 4, 2022

I'm really sorry to probably just waste your time as I'm very new to this repo, but I would appreciate you going a bit into detail on how introducing this new method, which seems to not be used anywhere else, would fix the tooltip issue? Again, don't want to waste your time, so any pointer would suffice.

I've searched the repo for occurrences of the ContainsMousePoint string and it's not present anywhere else except in the declaration of this method. Not in branches release/6.0 or main, nor in any other file changes in any other commit.

@SamBent
Copy link
Contributor

SamBent commented Feb 4, 2022

This comes from a bad merge. The original commit in PR #5931 changed MouseHasLeftSafeArea, including replacing a call to SafeArea.ContainsPoint with a call to SafeArea.ContainsMousePoint, changes to the signature of MouseHasLeftSafeArea, and corresponding changes to its callers. All these got wiped out by two later commits, attempting to merge other changes from main.

@singhashish-wpf , please restore the original commit. (In main, and in all servicing branches.)

@gmanny
Copy link

gmanny commented Feb 4, 2022

Yeah, I guess this was actually conflicting with this commit

@dipeshmsft dipeshmsft merged commit f4121ed into dotnet:release/6.0 Feb 7, 2022
@amirburbea
Copy link

amirburbea commented Mar 10, 2022

Tooltips are still broken in 6.0.3 - in some ways worse than before, is it possible the merge resolution was unsuccessful? Now tooltips seem to disappear everywhere. Run the popup-repro @ https://github.com/amirburbea/PopupRepro

Change the app between .NET5 & .NET6, check out tooltips in a ListBox (left) and in a ComboBox (right). It seems broken in both, whereas before it was only broken in the ComboBox.

@redseujac75
Copy link

Tooltips are still broken in 6.0.3 - in some ways worse than before, is it possible the merge resolution was unsuccessful? Now tooltips seem to disappear everywhere. Run the popup-repro @ https://github.com/amirburbea/PopupRepro

Change the app between .NET5 & .NET6, check out tooltips in a ListBox (left) and in a ComboBox (right). It seems broken in both, whereas before it was only broken in the ComboBox.

Confirmed!

ALL Tooltips in C#, WPF project developed in VS 2022 Community .Net 6.0.2, vanish immediately after appearing. This happens with all controls (buttons, text boxes ...) with a tooltip. This problem appeared after the most recent VS2022 update to .Net 6.0.3. among other things. It wasn't there with previous .Net 6 versions at least as far as buttons and textboxes were concerned.

Notice: the issue only occurs when I set the display scale to 125% or more, not with 100%.

@Mgamerz
Copy link

Mgamerz commented Mar 17, 2022

Can confirm borked tooltips (6.0.2). It's a serious detriment to my application on my laptop, which uses tooltips a ton, and has a high dpi screen (which >100% scaling).

I updated to 6.0.3 and now pretty much no tooltips work at all.

@dotnet dotnet locked as resolved and limited conversation to collaborators Apr 17, 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.

None yet

8 participants