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 348971 - gtk_status_icon_get_geometry returns bogus data
gtk_status_icon_get_geometry returns bogus data
Status: RESOLVED DUPLICATE of bug 340107
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-07-27 19:03 UTC by Matthias Clasen
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matthias Clasen 2006-07-27 19:03:48 UTC
Originally filed here: 
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=199740

gtk_status_icon_get_geometry often returns bogus data, at least as observed via
use by the python bindings. Various tests and conversations with Ray Strode and
Matthias suggest the problem arises because the geometry information is fully
known until the moment the icon is rendered into the notification area. However,
this is no signal emitted for this event making it difficult to know when one
the information is valid. The position information is needed to properly attach
a notification bubble to the icon.

Also, should the icon move because either the set of visible status icons
change, or because panel, or the notification area in the panel changes, there
is no way to properly update the positioning.

Perhaps providing a signal for when positioning changes (first display, any
subseqent move, etc.) would help address the problem in a generic manner.

The function does return a boolean if the returned information is valid but this
is not terribly useful because of the timing issues, this appears to be
compounded by the fact the python binding always return a tuple, at least
acording to the doc and observation, I didn't check the binding code.

After much fussing the only viable workaround I've come up with is to schedule a
timer callback for a short duration in the future after displaying the status
icon and querying the geometry then with the hope its valid at that moment the
timer fires. Attempts at adding an idle callback after displaying the icon to
perform geometry query were not reliable.
Comment 1 Matthias Clasen 2006-08-17 14:49:09 UTC
I added a warning to the docs. For 2.12, we should consider
turning is_embedded into a property with change notification.

2006-08-17  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkstatusicon.c (gtk_status_icon_get_geometry): Add some
	caveats to the documentation.  (#348971)
Comment 2 Matthias Clasen 2007-01-01 07:52:35 UTC

*** This bug has been marked as a duplicate of 340107 ***