Fixing incorrect mouse tooltip for TabPage of TabControl#6488
Merged
Tanya-Solyanik merged 1 commit intodotnet:mainfrom Jan 13, 2022
Conversation
Tanya-Solyanik
previously approved these changes
Jan 11, 2022
Contributor
Tanya-Solyanik
left a comment
There was a problem hiding this comment.
Looks good, please send to testing!
9cace45 to
c08cf35
Compare
Tanya-Solyanik
previously approved these changes
Jan 11, 2022
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).
c08cf35 to
017c680
Compare
Tanya-Solyanik
approved these changes
Jan 13, 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 #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
Buttonfrom 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
TabControlin the tooltip logicCustomer Impact
Regression?
Risk
Screenshots
Before
After
Test methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow