After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 599618 - better tooltip positioning
better tooltip positioning
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.20.x
Other All
: Normal normal
: 3.0
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-10-26 03:40 UTC by Matthias Clasen
Modified: 2016-04-15 04:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the patch (6.44 KB, patch)
2009-10-26 03:40 UTC, Matthias Clasen
none Details | Review

Description Matthias Clasen 2009-10-26 03:40:56 UTC
Created attachment 146242 [details] [review]
the patch

In Fedora 12, we have a GTK+ patch that changes the tooltip positioning to try
harder to avoid overlapping the tool you are tipping. I think it works very
well and gives a much more predictable behavior.
Comment 1 Kristian Rietveld 2009-11-01 15:25:19 UTC
I can see why it is useful to try harder to overlap the tool you are tipping.   This works well in the general case.  I think there's a couple of special cases where such behavior does not work well; and I guess the MAX_DISTANCE of 32 pixels is a way to make it not that bad for such cases.

You can find such cases in the testtooltips tests under gtk+/tests.  Try the test with the three boxes, for the yellow box the tooltip usually pops up near the cursor and the box.  For the top-left and top-right corners of the blue box it pops up at an awkward position (IMHO).  Same for the bottom corners of the red box.  If you point at the leftmost part of the rows in the tree view, the position of the tooltip does not have any predictable behavior.  It feels like this will be the case for many widgets that cover a large area and have individual contents that are not widgets.  For many of the labels in testtooltips, the tooltip pops up centered below the cursor. 

For the original positioning function, I have followed advice from Soeren, see:

  http://mail.gnome.org/archives/gtk-devel-list/2006-April/msg00201.html

He advised to have the tooltips position themselves right of the cursor and not centered below.  Of course, he is not a UI designer.  Maybe this is the right time to actually ask UI designers about good guidelines for tooltips positioning?
Comment 2 Matthias Clasen 2009-11-02 04:46:46 UTC
One thing that is worth mentioning here is that one could do a bit better than the algorithm in the patch does with widget-specific hints for preferred tooltip positioning. In some cases (menu items, vertical panels), it would be better to prefer left/right positioning over below/above.
Comment 3 Pavel Podkorytov 2016-04-15 04:20:12 UTC
This patch break gtk2 tooltip positions in some cases.

My case:
1. OS: Fedora 22, Fedora 23
2. gtk2 with this patch (default installation)
3. xfce4-panel, tint2 - system tray notifications has invalid position (http://imgur.com/mC27Pj2)
4. nouveau video driver

After rebuild gtk2 package without this patch problem is gone.