diff -ur gnome-panel/panel-applet-frame.c gnome-panel/panel-applet-frame.c.new
--- gnome-panel/panel-applet-frame.c	Sun Dec 15 15:51:34 2002
+++ gnome-panel/panel-applet-frame.c.new	Sat Mar  1 13:35:31 2003
@@ -975,6 +975,22 @@
 	return retval;
 }
 
+static void
+panel_applet_frame_size(PanelAppletFrame *frame, GtkAllocation *allocation, gpointer data)
+{
+	PanelWidget *panel = data;
+	PanelBackground *background;
+
+	background = &panel->background;
+
+	if (background->type == PANEL_BACK_IMAGE ||
+	    (background->type == PANEL_BACK_COLOR && background->has_alpha) ||
+	    (background->type == PANEL_BACK_NONE && background->default_pixmap))
+		{
+		panel_applet_frame_change_background (frame, background->type);
+		}
+}
+
 GtkWidget *
 panel_applet_frame_construct (PanelAppletFrame *frame,
 			      PanelWidget      *panel,
@@ -1053,6 +1069,9 @@
 
 	gtk_container_add (GTK_CONTAINER (frame), widget);
 
+	g_signal_connect (frame, "size_allocate",
+			  G_CALLBACK(panel_applet_frame_size), frame->priv->panel);
+
 	return widget;
 }
 
diff -ur gnome-panel/panel-background.c gnome-panel/panel-background.c.new
--- gnome-panel/panel-background.c	Mon Dec 16 22:05:50 2002
+++ gnome-panel/panel-background.c.new	Sat Mar  1 13:35:44 2003
@@ -65,6 +65,54 @@
 }
 
 static void
+set_applet_background (PanelBackground *background, GdkPixmap *pixmap)
+{
+	GdkGC *gc;
+	gint width, height;
+	gint x, y;
+	gint source_width, source_height;
+
+	if (!pixmap) {
+		if (background->applet_pixmap) {
+			g_object_unref (background->applet_pixmap);
+			background->applet_pixmap = NULL;
+		}
+	       	return;
+	}
+
+	gdk_drawable_get_size (GDK_DRAWABLE(background->window), &width, &height);
+	gdk_drawable_get_size (GDK_DRAWABLE(pixmap), &source_width, &source_height);
+
+	if (background->applet_pixmap) {
+		gint aw, ah;
+		gdk_drawable_get_size (GDK_DRAWABLE(background->applet_pixmap), &aw, &ah);
+		if (aw != width || ah != height) {
+			if (background->applet_pixmap) {
+				g_object_unref (background->applet_pixmap);
+				background->applet_pixmap = NULL;
+			}
+		}
+	}
+
+	if (!background->applet_pixmap) {
+		background->applet_pixmap =
+			gdk_pixmap_new (background->window, width, height, -1);
+	}
+
+	gc = gdk_gc_new(GDK_DRAWABLE(background->window));
+	for (x = 0; x < width; x += source_width)
+	    for (y = 0; y < height; y+= source_height)
+		gdk_draw_drawable (GDK_DRAWABLE (background->applet_pixmap),
+				   gc,
+				   GDK_DRAWABLE (pixmap),
+				   0, 0,
+				   x, y,
+				   width, height);
+
+	g_object_unref(gc);
+}
+
+static void
 set_pixbuf_background (PanelBackground *background)
 {
 	g_assert (background->composited_image != NULL);
@@ -76,6 +124,8 @@
 
 	gdk_window_set_back_pixmap (
 		background->window, background->pixmap, FALSE);
+
+	set_applet_background (background, background->pixmap);
 }
 
 static gboolean
@@ -90,12 +140,15 @@
 
 	switch (background->type) {
 	case PANEL_BACK_NONE:
-		if (background->default_pixmap)
+		if (background->default_pixmap) {
 			gdk_window_set_back_pixmap (
 				background->window, background->default_pixmap, FALSE);
-		else
+			set_applet_background (background, background->default_pixmap);
+		} else {
 			gdk_window_set_background (
 				background->window, &background->default_color);
+			set_applet_background (background, NULL);
+		}
 		break;
 	case PANEL_BACK_COLOR:
 		if (background->has_alpha &&
@@ -108,6 +161,7 @@
 				FALSE, TRUE);
 			gdk_window_set_background (
 				background->window, &background->color.gdk);
+			set_applet_background (background, NULL);
 		}
 		break;
 	case PANEL_BACK_IMAGE:
@@ -749,6 +803,8 @@
 	background->default_color.blue  = 0;
 	background->default_color.pixel = 0;
 
+	background->applet_pixmap = NULL;
+
 	background->fit_image     = FALSE;
 	background->stretch_image = FALSE;
 	background->rotate_image  = FALSE;
@@ -783,6 +839,9 @@
 	if (background->default_pixmap)
 		g_object_unref (background->default_pixmap);
 	background->default_pixmap = NULL;
+
+	if (background->applet_pixmap)
+		g_object_unref (background->applet_pixmap);
 }
 
 char *
@@ -797,11 +856,11 @@
 	    (background->type == PANEL_BACK_NONE && background->default_pixmap)) {
 		GdkNativeWindow pixmap_xid;
 
-		if (!background->window)
+		if (!background->applet_pixmap)
 			return NULL;
 
 		pixmap_xid = gdk_x11_drawable_get_xid (
-				GDK_DRAWABLE (background->window));
+				GDK_DRAWABLE (background->applet_pixmap));
 
 		retval = g_strdup_printf ("pixmap:%d,%d,%d", pixmap_xid, x, y);
 
diff -ur gnome-panel/panel-background.h gnome-panel/panel-background.h.new
--- gnome-panel/panel-background.h	Tue Dec  3 21:12:17 2002
+++ gnome-panel/panel-background.h.new	Sat Mar  1 13:36:00 2003
@@ -57,6 +57,8 @@
 	GdkPixmap              *default_pixmap;
 	GdkColor                default_color;
 
+	GdkPixmap              *applet_pixmap;
+
         guint                   fit_image : 1;
         guint                   stretch_image : 1;
         guint                   rotate_image : 1;
diff -ur libpanel-applet/panel-applet.c libpanel-applet/panel-applet.c.new
--- libpanel-applet/panel-applet.c	Mon Dec  9 17:21:56 2002
+++ libpanel-applet/panel-applet.c.new	Sat Mar  1 13:42:18 2003
@@ -795,7 +795,8 @@
 			 int              x,
 			 int              y)
 {
-	GdkWindow *window;
+	GdkPixmap *pixmap;
+	GdkDisplay *display;
 	GdkPixmap *retval;
 	GdkGC     *gc;
 	int        width;
@@ -806,13 +807,15 @@
 	if (!GTK_WIDGET_REALIZED (applet))
 		return NULL;
 
-	window = gdk_window_lookup (xid);
-	if (window)
-		g_object_ref (window);
+	display = gdk_display_get_default ();
+	
+	pixmap = gdk_pixmap_lookup_for_display (display, xid);
+	if (pixmap)
+		g_object_ref (pixmap);
 	else
-		window = gdk_window_foreign_new (xid);
+		pixmap = gdk_pixmap_foreign_new_for_display(display, xid);
 
-	g_return_val_if_fail (window != NULL, NULL);
+	g_return_val_if_fail (pixmap != NULL, NULL);
 
 	gdk_drawable_get_size (GDK_DRAWABLE (GTK_WIDGET (applet)->window),
 			       &width, &height);
@@ -825,13 +828,13 @@
 
 	gdk_draw_drawable (GDK_DRAWABLE (retval),
 			   gc, 
-			   GDK_DRAWABLE (window),
+			   GDK_DRAWABLE (pixmap),
 			   x, y,
 			   0, 0,
 			   width, height);
 
 	g_object_unref (gc);
-	g_object_unref (window);
+	g_object_unref (pixmap);
 
 	return retval;
 }
