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 703460 - Misplaced tooltips due to positioning using the allocation, which may not yet be set
Misplaced tooltips due to positioning using the allocation, which may not yet...
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: Other
3.22.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 698730 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-07-02 13:55 UTC by Lionel Landwerlin
Modified: 2018-05-02 15:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tooltip: fix missplaced tooltips (1.83 KB, patch)
2013-07-02 13:56 UTC, Lionel Landwerlin
none Details | Review
screenshot of the issue (88.30 KB, image/png)
2013-07-02 13:58 UTC, Lionel Landwerlin
  Details
tooltip: fix missplaced tooltips (1.90 KB, patch)
2013-07-19 10:23 UTC, Lionel Landwerlin
none Details | Review

Description Lionel Landwerlin 2013-07-02 13:55:04 UTC
Attached is a screenshot of nautilus with the mouse pointer positioned in the center of the button. The tooltip's position is fairly offset from where it should be, centered relatively to the position/size of the button and size of the tooltip.

The reason for this is that once you call gtk_widget_hide() on the tooltip, the allocation its allocated size is set to -1x-1. Once you end up if with a hidden and already realized widget, the only to get another valid allocation is to actually show the widget. Unfortunately the tooltip code assumes that once it called gtk_widget_realize() the widget will have a valid allocation.

The attached patch replace the gtk_widget_realize() call by a gtk_widget_get_preferred_size() call.
Comment 1 Lionel Landwerlin 2013-07-02 13:56:32 UTC
Created attachment 248221 [details] [review]
tooltip: fix missplaced tooltips
Comment 2 Lionel Landwerlin 2013-07-02 13:58:50 UTC
Created attachment 248222 [details]
screenshot of the issue
Comment 3 Matthias Clasen 2013-07-04 00:42:56 UTC

*** This bug has been marked as a duplicate of bug 703471 ***
Comment 4 Lionel Landwerlin 2013-07-04 08:38:12 UTC
Matthias, I'm reopening because these 2 bugs are separate issues.

This one is a about an incorrect positioning of tooltips because the allocation reported by gtk_widget_get_allocation is invalid, which leads to a wrong positioning.

703471 is about the positioning code not doing something "pretty", regardless of whether the allocation of the widget is correct or not.
Comment 5 Lionel Landwerlin 2013-07-19 10:23:59 UTC
Created attachment 249596 [details] [review]
tooltip: fix missplaced tooltips

Reword the patch's comment.
Comment 6 Matthias Clasen 2018-02-10 05:10:05 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:52:00 UTC
*** Bug 698730 has been marked as a duplicate of this bug. ***
Comment 8 Daniel Boles 2018-03-30 14:56:37 UTC
It looks like a partial fix for this was committed from Bug 698730, but the core point of this one still stands, I think. And I think that at a glance, the patch here is tidier, simplier, and more future-proof (iirc in GTK+ 4, widgets can have 0x0 allocations)
Comment 9 GNOME Infrastructure Team 2018-05-02 15:42:15 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/431.