Improve editor tooltip mouse ignore area computation. #9028
+60
−72
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.
Some editor tooltips are interactive. To be able to enter the tooltip with the mouse, a rectangle is computed which prevents the tooltip to hide, even if the mouse leaves the component (which would hide it instantly).
This improves this mechanism slightly by
other:
ToolTipAnnotationand minor cleanup in that class (no other changes).debug graphics indicates the ignore area, before:

after:

please note the area is now wider and the tooltip moved even more to the left, I was just too lazy to re-create the screenshot.
also: the code path is shared with some other editor tooltips, e.g ctrl+hover javadoc tooltip
other things I tried:
Why can't it be the entire width of the tooltip? Because this would prevent neighboring components to spawn their own tooltip (see example with
foo,bar,baznext to each other). I did try to fight this problem by making the ignore area time based - but this made the code even more complicated and harder to maintain.things I didn't try but could further improve this mechanism:
Use a trapezoid instead of a rectangle (upper part could have the width of the tooltip)
closes #8961 (alternative proposal)