GNOME Bugzilla – Bug 348971
gtk_status_icon_get_geometry returns bogus data
Last modified: 2011-02-04 16:11:01 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.
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)
*** This bug has been marked as a duplicate of 340107 ***