Community
Participate
Working Groups
Created attachment 228633 [details] Sample code reproducing the problem Tooltips created using ColumnViewerToolTipSupport fails to show on Linux if they extend beyond the right edge of the display. Can be reproduced using the attached ToolTipView example: 1. Create a plug-in with the view example (tree) 2. Replace the ToolTipView.java with the attached version. 3. Launch Eclipse with the new plug-in and open the "ToolTip view" 4. Position the view to the far right side of the display 5. Expand the tree and position the mouse pointer of the the various elements Note how shorter tooltips fitting within the display are shown properly while longer once fails to display. Same code runs fine on Mac/OSX where the tooltip is shifted to the left to fit within the display.
A workaround is to cause the ViewLabelProvider to always use native tooltips: class ViewLabelProvider extends CellLabelProvider { ... @Override public boolean useNativeToolTip(Object object) { return true; } } The custom tooltips support has other issues on MacOS X. I began investigating in bug 372576, but the code is a bit hard to follow as several methods have side-effects.
The workaround helps, but has a flaw in the if you hover over one element and then move out of the view and then back in again - but not directly over any element - the old tooltip is shown as if it is for the element next to the mouse pointer. Attaching a screenshot showing this behavior, were I started with showing the tooltip for "Leaf 2", moved out and back in next to "Leaf 4".
Created attachment 228813 [details] Screenshot show the "old" tooltip over a "new" element
It seems to me like ToolTip.shouldHideToolTip sometimes wrongly decides that the tooltip should be hidden because getToolTipArea != currentArea. This seems to be particularly true when adjusting for the cursor. Setting a custom shift like below seems to prevent the bug from happening to me: class ViewLabelProvider extends CellLabelProvider { ... @Override public Point getToolTipShift(Object object) { return new Point(10, 2); } } Maybe ToolTip needs to be a bit smarter when it decides if it should be hidden or when it adjusts for the cursor?
(In reply to Björn Arnelid from comment #4) > It seems to me like ToolTip.shouldHideToolTip sometimes wrongly decides that > the tooltip should be hidden because getToolTipArea != currentArea. This > seems to be particularly true when adjusting for the cursor. Setting a > custom shift like below seems to prevent the bug from happening to me: > > class ViewLabelProvider extends CellLabelProvider { > ... > @Override > public Point getToolTipShift(Object object) { > return new Point(10, 2); > } > } > > Maybe ToolTip needs to be a bit smarter when it decides if it should be > hidden or when it adjusts for the cursor? https://wiki.eclipse.org/Platform_UI/How_to_Contribute :-)
(In reply to Andrey Loskutov from comment #5) > > https://wiki.eclipse.org/Platform_UI/How_to_Contribute :-) Sure, i will make sure to contribute a patch if i manage to figure out the actual problem.
I was unable to recreate this in eclipse 4.7.1a and in eclipse the eclipse photon nightly build. Maybe this got accidentally fixed somehow?
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.