Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 372576 - [JFace] ColumnViewerToolTipSupport causes tooltip flicker on MacOS X
Summary: [JFace] ColumnViewerToolTipSupport causes tooltip flicker on MacOS X
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-25 12:26 EST by Brian de Alwis CLA
Modified: 2019-11-14 03:13 EST (History)
2 users (show)

See Also:


Attachments
Test program using JFace and SWT (4.54 KB, application/octet-stream)
2012-02-25 12:26 EST, Brian de Alwis CLA
no flags Details
Patch to ColumnViewerToolTipSupport (1.93 KB, patch)
2012-02-25 12:29 EST, Brian de Alwis CLA
no flags Details | Diff
Revised test program using JFace and SWT with different forms of per-column tooltips (5.30 KB, application/octet-stream)
2012-03-10 12:31 EST, Brian de Alwis CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian de Alwis CLA 2012-02-25 12:26:05 EST
Created attachment 211624 [details]
Test program using JFace and SWT

Version: 4.2.0
Build id: I20120222-2200

I noticed tooltips flicker when using ColumnLabelProviders, regardless of native or non-native tooltips.  Attached is a little demo program that simply presents the file system as a tree from the roots.  If you hover over long filenames, you'll notice a tooltip appears, disappears, and then reappears.
Comment 1 Brian de Alwis CLA 2012-02-25 12:29:44 EST
Created attachment 211625 [details]
Patch to ColumnViewerToolTipSupport

The cause of the flicker is that shouldCreateToolTip(Event) sets the tooltip text to an empty string before determining how it should be changed.  This causes the tooltip to disappear, and then reappear.

The solution is to avoid setting the tooltip until determined that it needs to be set.

With this patch, I never see flicker.

Tom, could you please verify?
Comment 2 Brian de Alwis CLA 2012-03-10 12:31:03 EST
Created attachment 212424 [details]
Revised test program using JFace and SWT with different forms of per-column tooltips

So my patch fixes the problem works when tooltips are all native and don't actually have any tooltip text (thereby.  It doesn't fix behaviour when mixing columns with native and non-native tooltips *and* where the native tooltip column doesn't provide text.  In these circumstance you will still see tooltip flashing.  

I've revised the demo program to include three per-column label providers, one using native tooltips but with no tooltip text, one using native tooltips but providing tooltip text, and the last using JFace tooltips with provided tooltip text.  If you move between the columns on MacOS X Cocoa, you'll see some interesting behaviours.

1. Moving from the native-no-tooltip to native-with-tooltip: the native tooltip never appears, likely as the control's tooltip was set to "" and never unset.

2. Moving from the native-with-tooltip or jface-tooltip to native-no-tooltip: the native tooltip for the column appears, which is then removed and replaced with the jface tooltip

JFace-handled tooltips also appear when the window doesn't have focus, whereas native tooltips do not (though I personally find this behaviour kinda handy).

I think the problem is that ColumnViewerToolTipSupport#shouldCreateToolTip() should be called when the cursor enters or leaves the cell area, rather than to show the tooltip.  And it should not have side-effects.  But this will have to wait to M7.
Comment 3 Lars Vogel CLA 2019-11-14 03:13:03 EST
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.

If you have further information on the current state of the bug, please add it. 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.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.