Skip to content

Prevent Toolbar tooltips from appearing directly under cursor hotspot #12959

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

Merged
merged 2 commits into from
Apr 16, 2025

Conversation

toehead2001
Copy link
Contributor

@toehead2001 toehead2001 commented Feb 15, 2025

Fixes #12958

Proposed changes

  • This positions the ToolTip so that it is offset by 1px from the cursor's HotSpot X value.

Customer Impact

  • This prevents ToolStrip tooltips from appearing directly under cursor HotSpot. Thus, the user is able to click the ToolStripItem.

Regression?

  • No

Risk

Screenshots

Before

After

Test methodology

  • Manually tested.

Accessibility testing

Test environment(s)

Microsoft Reviewers: Open in CodeFlow

Copy link

codecov bot commented Feb 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.24890%. Comparing base (ff73bfe) to head (e527763).
Report is 25 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #12959         +/-   ##
===================================================
+ Coverage   62.15778%   62.24890%   +0.09111%     
===================================================
  Files           1555        1557          +2     
  Lines         159256      159251          -5     
  Branches       14849       14864         +15     
===================================================
+ Hits           98990       99132        +142     
+ Misses         59522       59367        -155     
- Partials         744         752          +8     
Flag Coverage Δ
Debug 62.24890% <ø> (+0.09111%) ⬆️
integration 11.31392% <ø> (+0.01436%) ⬆️
production 40.37670% <ø> (+0.06508%) ⬆️
test 95.66950% <ø> (+0.00348%) ⬆️
unit 37.73271% <ø> (+0.07970%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -4505,6 +4505,7 @@ internal void UpdateToolTip(ToolStripItem? item, bool refresh = false)
if (_currentlyActiveTooltipItem is not null && !GetToolStripState(STATE_DRAGGING) && Cursor.Current is { } currentCursor)
{
Point cursorLocation = Cursor.Position;
cursorLocation.X += currentCursor.HotSpot.X + 1;

Choose a reason for hiding this comment

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

Might be worth putting a comment here explaining why the X coordinate is being fudged

@merriemcgaw merriemcgaw requested a review from JeremyKuhne March 10, 2025 23:15
@merriemcgaw
Copy link
Member

@Olina-Zhang can your team build this fix and test it out? And can you (or @LeafShi1 ) update the PR branch so it's up to date?

@Olina-Zhang
Copy link
Member

@merriemcgaw @toehead2001 Tested this PR change, here is the result, please have a look:

  1. Fixed: the display of mouse tooltip is on the right of current cursor position when moving toolStrip to above the Windows Taskbar, no overlap and no blinking, can click item easily
WithPrivates_Case1Fixed.mp4
  1. Not fixed: Issue is still reproduced when moving toolStrip to the bottom right corner of the screen, and there isn't enough space to display tooltip on the right of current mouse cursor position
WithPrivates_Case2NotFixed.mp4

@Tanya-Solyanik
Copy link
Member

@Olina-Zhang - did issue2 become worse after the fix?

@Olina-Zhang
Copy link
Member

@Olina-Zhang - did issue2 become worse after the fix?

No, same result as before.

@Tanya-Solyanik
Copy link
Member

@merriemcgaw @Olina-Zhang - I think the second issue is minor and can be ignored, especially since it didn't get worse with this change.

Copy link
Member

@Tanya-Solyanik Tanya-Solyanik left a comment

Choose a reason for hiding this comment

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

Thank you!

@Tanya-Solyanik Tanya-Solyanik added the ready-to-merge PRs that are ready to merge but worth notifying the internal team. label Apr 16, 2025
@merriemcgaw merriemcgaw enabled auto-merge (squash) April 16, 2025 02:40
@merriemcgaw merriemcgaw merged commit 56b01cc into dotnet:main Apr 16, 2025
8 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0 Preview4 milestone Apr 16, 2025
@dotnet-policy-service dotnet-policy-service bot removed the ready-to-merge PRs that are ready to merge but worth notifying the internal team. label Apr 16, 2025
@toehead2001 toehead2001 deleted the tooltip-offset branch April 16, 2025 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ToolStrip tooltips can appear directly under cursor hotspot
5 participants