GNOME Bugzilla – Bug 167771
The panel does not emit "change_background" signals frequently enough.
Last modified: 2005-12-28 21:11:37 UTC
On pixmap/transparency backgrounds, when the size of an applet changes on the panel (particularly in the case of getting bigger) the panel needs to emit a "change_background" signal so that the widget's now-larger background can be painted again. In reality, this happens only sometimes. When it fails to happen, the background wraps inside the applet. For example, if the widget was originally 20 pixels wide and then grew to 40 pixels, the original 20 pixels worth of background image will be repeated twice. This effect can be seen in all sorts of stock gnome applets on a transparent panel.
The problem is a sort of race condition. When a new size_allocate happens for an applet in the panel it sends a change_background signal to the applet. The size_allocate happens automatically (I think) through GtkSocket/Plug (which is what bonoboui uses). The change_background is delivered explicitly via bonobo. If the change_background gets there before the size_allocate then the background is changed while the widget is too small to accept the entire background, then the widget gets larger and the background wraps. To fix the race condition, the applets could be changed to explicit request background updates once they've received their new size allocations. There might be a better way but I'm not sure of what it would be (other than somehow delaying either the sending or processing of the change_background signal in hopes of removing the race)
Created attachment 37696 [details] [review] proof of concept This makes one of the changes described above to the window-list applet (namely, manually requesting the new background information from the applet *after* the size allocation has occured.) This works for me. This will need to be done to all of the other applets so feedback would be appreciated.
Created attachment 37698 [details] [review] better patch the old patch broke the case where the background changes when moving the applet to a new place on the panel. this patch restores the old functionality plus the new functionality at the cost of doing background updates twice when the applet is resized. there's no noticeable performance issue. if this is really a problem, the panel could be adjusted to not send change_background signals on resize (probably only a good idea after all of the other applets are fixed and after gnome 2.10 is released).
Ryan: I looked at the problem a few days ago and came to the same conclusion. I'm trying to see if this can be fixed in the panel or in libpanel-applet. I don't think every applet should be forced to connect to the size-allocate signal just for that...
Even as things are now, every applet has its own copy of the magical transparency code that nobody really understands but just copies between applets. This has always sort of bothered me, so I agree with you that if we're thinking about this, a better solution is probably needed. What do you think about the idea of just taking something similar to the above code and putting it into libpanel-applet?
I was thinking about it when I pasted the code in some applets :-) Something like panel_applet_apply_background_to_widget() would be useful. Or maybe just something like panel_applet_set_widget_for_background() and then libpanel-applet would automagically set the background on the widget on background changes... But it won't happen for 2.10.
And therein lies the problem. libpanel-applet can't change API for 2.10 and we don't want to make changes to all of the applets individually because it's the wrong way to do it. Yet we are still left with a annoying visible bug in the release. This is why it's nice to branch stable some time before the release. :)
Created attachment 47220 [details] [review] combat, baby. sorry for the delay. this is a patch that does 3 things 1) fixes the problem with backgrounds not being updated by doing an update on every size-allocate 2) adds the discussed API (called 'panel_applet_track_background' instead only because it's shorter) 3) port wncklet/clock/fish/notification to use the new API and remove their own transparency-handling code it works well for me. comments and suggestions appreciated.
*** Bug 314373 has been marked as a duplicate of this bug. ***
can we commit this soon?
This bug needs to be resolved, if someone could review the patch. The added function should also be added in the python gnomeapplet bindings (in gnome-python-extras)
*** Bug 318093 has been marked as a duplicate of this bug. ***
Finally committed it. Thanks Ryan!