Bug 403770 - ColumnViewerToolTipSupport fails to show on Linux
Summary: ColumnViewerToolTipSupport fails to show on Linux
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2.2   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2013-03-19 09:35 EDT by Fredrik Attebrant CLA
Modified: 2020-07-28 13:14 EDT (History)
4 users (show)

See Also:


Attachments
Sample code reproducing the problem (8.39 KB, application/octet-stream)
2013-03-19 09:35 EDT, Fredrik Attebrant CLA
no flags Details
Screenshot show the "old" tooltip over a "new" element (127.79 KB, image/png)
2013-03-21 03:47 EDT, Fredrik Attebrant CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fredrik Attebrant CLA 2013-03-19 09:35:43 EDT
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.
Comment 1 Brian de Alwis CLA 2013-03-20 09:23:26 EDT
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.
Comment 2 Fredrik Attebrant CLA 2013-03-21 03:46:20 EDT
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".
Comment 3 Fredrik Attebrant CLA 2013-03-21 03:47:37 EDT
Created attachment 228813 [details]
Screenshot show the "old" tooltip over a "new" element
Comment 4 Björn Arnelid CLA 2016-10-07 07:27:29 EDT
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?
Comment 5 Andrey Loskutov CLA 2016-10-07 07:30:02 EDT
(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 :-)
Comment 6 Björn Arnelid CLA 2016-10-07 07:37:45 EDT
(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.
Comment 7 Björn Arnelid CLA 2017-12-05 04:19:27 EST
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?
Comment 8 Eclipse Genie CLA 2020-07-28 13:14:55 EDT
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.