Skip to content

Fixing incorrect mouse tooltip for TabPage of TabControl#6488

Merged
Tanya-Solyanik merged 1 commit intodotnet:mainfrom
WPMGPRoSToTeMa:Issue_4750_Fixing_Incorrect_Mouse_Tooltip_for_TabPage_of_TabControl
Jan 13, 2022
Merged

Fixing incorrect mouse tooltip for TabPage of TabControl#6488
Tanya-Solyanik merged 1 commit intodotnet:mainfrom
WPMGPRoSToTeMa:Issue_4750_Fixing_Incorrect_Mouse_Tooltip_for_TabPage_of_TabControl

Conversation

@WPMGPRoSToTeMa
Copy link
Contributor

@WPMGPRoSToTeMa WPMGPRoSToTeMa commented Jan 11, 2022

Fixes #4750. The DELTOOL message of tooltip causes moving of the last tool to the slot of the deleted tool in the tool array (e.g. deleting Button from the [Button, TabControl, TabPage1, TabPage2] results in [TabPage2, TabControl, TabPage1]). This breaks the hit-test logic of the tooltip that checks the tools in the reverse order. Thus the TabControl may be checked earlier than any of TabPages and tooltip will be shown for the TabControl and not for the TabPage.

A possible fix is to reorder the tools in the tools array, but there is no way to access it directly. It is possible to change the array through GETTOOLINFO and SETTOOLINFO messages but this may have undesirable side-effects of breaking caches and other things.

The other way is to remove deletion from the keyboard tooltips logic. But it won't actually help because deletion may be called directly.

The only appropriate solution is to not add a tool for the TabControl itself. It doesn't break anything because the TabControl relays mouse messages to the tooltip by itself (no subclassing is needed) and there is no area where the tool for the TabControl will be shown (hit-testing detects only TabPages, the other things are transparent).

Proposed changes

  • Removed adding a tool for the TabControl in the tooltip logic

Customer Impact

  • The user sees the correct tooltip in the correct rectangle for a tab page of tab control

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

After

Test methodology

  • Manual testing
  • Unit-tests
  • CTI

Test environment(s)

  • Microsoft Windows [Version 10.0.19044.1415]
  • .NET 7.0.0-alpha.1.22058.4
Microsoft Reviewers: Open in CodeFlow

@WPMGPRoSToTeMa WPMGPRoSToTeMa requested a review from a team as a code owner January 11, 2022 01:03
@ghost ghost assigned WPMGPRoSToTeMa Jan 11, 2022
@WPMGPRoSToTeMa WPMGPRoSToTeMa added the waiting-review This item is waiting on review by one or more members of team label Jan 11, 2022
Tanya-Solyanik
Tanya-Solyanik previously approved these changes Jan 11, 2022
Copy link
Contributor

@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.

Looks good, please send to testing!

@Tanya-Solyanik Tanya-Solyanik added waiting-for-testing The PR is awaiting manual testing by the primary team; no action is yet required from the author(s) and removed waiting-review This item is waiting on review by one or more members of team labels Jan 11, 2022
@WPMGPRoSToTeMa WPMGPRoSToTeMa force-pushed the Issue_4750_Fixing_Incorrect_Mouse_Tooltip_for_TabPage_of_TabControl branch from 9cace45 to c08cf35 Compare January 11, 2022 08:07
Tanya-Solyanik
Tanya-Solyanik previously approved these changes Jan 11, 2022
@Amy-Li03
Copy link
Contributor

Testing has completed with no new issue found.

Fixes dotnet#4750. The DELTOOL message of tooltip causes moving of the last tool to the slot of the deleted tool in the tool array (e.g. deleting `Button` from the `[Button, TabControl, TabPage1, TabPage2]` results in `[TabPage1, TabControl, TabPage2]`). This breaks the hit-test logic of the tooltip that checks the tools in the reverse order. Thus the TabControl may be checked earlier than any of TabPages and tooltip will be shown for the TabControl and not for the TabPage.

A possible fix is to reorder the tools in the tools array, but there is no way to access it directly. It is possible to change the array through GETTOOLINFO and SETTOOLINFO messages but this may have undesirable side-effects of breaking caches and other things.

The other way is to remove deletion from the keyboard tooltips logic. But it won't actually help because deletion may be called directly.

The only appropriate solution is to not add a tool for the TabControl itself. It doesn't break anything because the TabControl relays mouse messages to the tooltip by itself (no subclassing is needed) and there is no area where the tool for the TabControl will be shown (hit-testing detects only TabPages, the other things are transparent).
@WPMGPRoSToTeMa WPMGPRoSToTeMa force-pushed the Issue_4750_Fixing_Incorrect_Mouse_Tooltip_for_TabPage_of_TabControl branch from c08cf35 to 017c680 Compare January 13, 2022 02:35
@Tanya-Solyanik Tanya-Solyanik merged commit 5387bb1 into dotnet:main Jan 13, 2022
@ghost ghost added this to the 7.0 Preview1 milestone Jan 13, 2022
@WPMGPRoSToTeMa WPMGPRoSToTeMa deleted the Issue_4750_Fixing_Incorrect_Mouse_Tooltip_for_TabPage_of_TabControl branch January 13, 2022 13:48
@ghost ghost locked as resolved and limited conversation to collaborators Feb 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

waiting-for-testing The PR is awaiting manual testing by the primary team; no action is yet required from the author(s)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Accessibility] The mouse tooltip of second TabPage is not correct when setting TabControl, tabpages' tooltip, and another control's tooltip

3 participants