Index: libpanel-applet/panel-applet.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/libpanel-applet/panel-applet.c,v
retrieving revision 1.90
diff -u -p -r1.90 panel-applet.c
--- libpanel-applet/panel-applet.c	17 Aug 2004 12:03:48 -0000	1.90
+++ libpanel-applet/panel-applet.c	4 Nov 2004 02:23:43 -0000
@@ -77,6 +77,8 @@ struct _PanelAppletPrivate {
 	gboolean                    moving_focus_out;
 
 	gboolean                    locked_down;
+
+	guint                       background_handler_id;
 };
 
 static GObjectClass *parent_class;
@@ -416,6 +418,10 @@ panel_applet_finalize (GObject *object)
 		g_closure_unref (applet->priv->closure);
 	applet->priv->closure = NULL;
 
+	if (applet->priv->background_handler_id)
+		g_source_remove (applet->priv->background_handler_id);
+	applet->priv->background_handler_id = 0;
+
 	parent_class->finalize (object);
 }
 
@@ -943,13 +949,14 @@ panel_applet_get_prop (BonoboPropertyBag
 	}
 }
 
-static void
-panel_applet_handle_background (PanelApplet *applet)
+static gboolean
+panel_applet_handle_background_cb (PanelApplet *applet)
 {
 	PanelAppletBackgroundType  type;
 	GdkColor                   color;
 	GdkPixmap                 *pixmap = NULL;
 
+	applet->priv->background_handler_id = 0;
 	type = panel_applet_handle_background_string (applet, &color, &pixmap);
 
 	switch (type) {
@@ -974,7 +981,18 @@ panel_applet_handle_background (PanelApp
 		g_assert_not_reached ();
 		break;
 	}
+	return FALSE;
+}
+static void
+panel_applet_handle_background (PanelApplet *applet)
+{
+	if (!applet->priv->background_handler_id) {
+		applet->priv->background_handler_id =
+			g_idle_add ((GSourceFunc)panel_applet_handle_background_cb,
+				    applet);
+	}
 }
+
 
 static void
 panel_applet_set_prop (BonoboPropertyBag *sack,
