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 703471 - tooltips misplaced on large/tall widgets
tooltips misplaced on large/tall widgets
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: Other
3.22.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-07-02 15:35 UTC by Lionel Landwerlin
Modified: 2018-05-02 15:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot of the issue (93.96 KB, image/png)
2013-07-02 15:36 UTC, Lionel Landwerlin
  Details
tooltip: rework positionning under pointer (1.77 KB, patch)
2013-07-02 15:39 UTC, Lionel Landwerlin
none Details | Review

Description Lionel Landwerlin 2013-07-02 15:35:48 UTC
Attached is a screenshot of nautilus showing the tooltip from the treeview at a fairly unexpected position.

I believe the problem is that the positioning code of GtkTooltip is assuming that the whatever widget we display the tooltip on, the widget will always be small enough saw that the distance between the border of the widget and the position of the mouse pointer is inferior to the size of the mouse cursor + 32 pixels.

That is not the case on large widget like a treeview.

You can also try this on this small example :

=======================================================

const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;

for (let i in Gtk)
    log(Gtk[i]);
log(Gtk);

Gtk.init(null, null);

let mwindow = new Gtk.Window();
mwindow.resize(500,500);

let button = new Gtk.Button({ label: "plop" });
button.set_tooltip_text('fffffffffffffffffffffffffffuuuuuu');
mwindow.add(button);

mwindow.show_all();

Gtk.main();

=======================================================

The attached patch provides an improvement over tooltip positioning.
Comment 1 Lionel Landwerlin 2013-07-02 15:36:44 UTC
Created attachment 248239 [details]
screenshot of the issue
Comment 2 Lionel Landwerlin 2013-07-02 15:39:00 UTC
Created attachment 248241 [details] [review]
tooltip: rework positionning under pointer
Comment 3 Matthias Clasen 2013-07-04 00:42:09 UTC
> I believe the problem is that the positioning code of GtkTooltip is assuming
> that the whatever widget we display the tooltip on, the widget will always be
> small enough saw that the distance between the border of the widget and the
> position of the mouse pointer is inferior to the size of the mouse cursor + 32
> pixels.

I think this is a bit of misunderstanding what the (admittedly undocumented) tooltip positioning code is trying to achieve. We are trying to place the tooltip outside the widget, unless a) that would move it outside the monitor or b) that would put it too far away from the pointer.
Comment 4 Matthias Clasen 2013-07-04 00:42:56 UTC
*** Bug 703460 has been marked as a duplicate of this bug. ***
Comment 5 Lionel Landwerlin 2013-07-04 14:03:57 UTC
I believe there a problem with the algorithm. The screenshot of the issue clearly shows a tooltip not as close as it could be from the pointer's position.

I will rework the patch so that the tooltip is always outside of the widget.
Comment 6 Matthias Clasen 2018-02-10 05:24:19 UTC
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
Comment 7 Daniel Boles 2018-03-30 14:59:32 UTC
It seems this is still relevant.

See also https://gitlab.gnome.org/GNOME/gtk/issues/134, in which a larger-than-normal cursor appears over the tooltip - presumably because we assume a fixed, too small size of the cursor when moving the tooltip away from it, so it's too *close* to the pointer. So that may just be a dupe of this.
Comment 8 GNOME Infrastructure Team 2018-05-02 15:42:42 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/432.