GNOME Bugzilla – Bug 157303
pixmap background for panel applets doesn't seem to work right.
Last modified: 2004-12-22 21:47:04 UTC
If I change the panel background to a pixmap (either by choosing a background image, or a semi-transparent colour), I get warnings like the following quite often: ** (trashapplet:3101): CRITICAL **: panel_applet_get_pixmap: assertion `pixmap != NULL' failed ** (trashapplet:3101): WARNING **: Failed to get pixmap 12616677,1250,0 When this happens, libpanel-applet tells the applet to display as PANEL_NO_BACKGROUND since it fails to find the pixmap ID. When I moved the code for emitting "change-background" to an idle function, rather than performing it directly in the Bonobo::PropertyBag set_prop handler, the problem went away. This patch is attached to the bug report. Does this sound like the right way to fix the problem, or is it just masking a problem in gnome-panel?
Created attachment 33412 [details] [review] gnome-panel-applet-background.patch
This really needs to be resolved for 2.10, it's been a problem for too long.
After a bit more testing, it seems that my patch doesn't fix the problem but just reduces its occurence a lot. This indicates that it is probably a timing issue.
See also bug #128167
Created attachment 33452 [details] [review] panel-background-sync.patch New patch that probably fixes the real problem. My previous patch just masked the problem by introducing a bit of a delay between the applet receiving the background change notification and actually processing it. The real problem is that not all of the X commands the panel used to draw the panel background had been processed before the panel told the applets about the new background. This patch adds a gdk_display_sync() call to the end of panel_background_prepare(), so that once the background is prepared, it is safe to notify the applets.
Makes sense. Wouldn't it be better to just sync when we're using a pixmap for the background (in set_pixbuf_background, e.g.)?
Possibly. It doesn't have any noticable effect with a solid background though. Mark: does this patch look okay?
Comment on attachment 33452 [details] [review] panel-background-sync.patch Ok for me.
Checked in on head.