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 167771 - The panel does not emit "change_background" signals frequently enough.
The panel does not emit "change_background" signals frequently enough.
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: libpanel-applet
git master
Other All
: Normal normal
: ---
Assigned To: Panel Maintainers
Panel Maintainers
: 314373 318093 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-02-18 03:31 UTC by Allison Karlitskaya (desrt)
Modified: 2005-12-28 21:11 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
proof of concept (1.64 KB, patch)
2005-02-20 05:03 UTC, Allison Karlitskaya (desrt)
none Details | Review
better patch (1.49 KB, patch)
2005-02-20 05:45 UTC, Allison Karlitskaya (desrt)
none Details | Review
combat, baby. (19.01 KB, patch)
2005-06-04 00:39 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Allison Karlitskaya (desrt) 2005-02-18 03:31:20 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.
Comment 1 Allison Karlitskaya (desrt) 2005-02-20 04:38:41 UTC
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)
Comment 2 Allison Karlitskaya (desrt) 2005-02-20 05:03:17 UTC
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.
Comment 3 Allison Karlitskaya (desrt) 2005-02-20 05:45:12 UTC
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).
Comment 4 Vincent Untz 2005-02-20 14:32:21 UTC
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...
Comment 5 Allison Karlitskaya (desrt) 2005-02-20 17:34:04 UTC
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?
Comment 6 Vincent Untz 2005-02-20 17:39:59 UTC
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.
Comment 7 Allison Karlitskaya (desrt) 2005-02-20 17:50:56 UTC
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. :)
Comment 8 Allison Karlitskaya (desrt) 2005-06-04 00:39:09 UTC
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.
Comment 9 Allison Karlitskaya (desrt) 2005-09-11 16:55:49 UTC
*** Bug 314373 has been marked as a duplicate of this bug. ***
Comment 10 Christian Kirbach 2005-09-11 22:06:57 UTC
can we commit this soon?
Comment 11 Raphael Slinckx 2005-11-20 22:16:28 UTC
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)
Comment 12 Allison Karlitskaya (desrt) 2005-12-23 03:54:09 UTC
*** Bug 318093 has been marked as a duplicate of this bug. ***
Comment 13 Vincent Untz 2005-12-28 21:11:37 UTC
Finally committed it. Thanks Ryan!