Red Hat Bugzilla – Bug 199740
gtk_status_icon_get_geometry returns bogus data
Last modified: 2007-11-30 17:11:38 EST
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.
Created attachment 132830 [details]
test case in python
test case, no args, position immediately, -i = get geometry in idle loop, -t
schedule timer event
Moved upstream, where I track GTK+ bugs: