diff -Naur metacity-2.10.1/src/compositor.c metacity-2.10.1-change/src/compositor.c
--- metacity-2.10.1/src/compositor.c	2005-02-24 22:02:44.000000000 +0000
+++ metacity-2.10.1-change/src/compositor.c	2005-06-27 22:19:38.000000000 +0100
@@ -316,7 +316,7 @@
               XserverRegion   damage_region)
 {
   XserverRegion region;
-  Picture buffer_picture;
   Pixmap buffer_pixmap;
   Display *xdisplay;
   XRenderPictFormat *format;
@@ -350,30 +350,36 @@
                         damage_region);
     }
 
-  buffer_pixmap = XCreatePixmap (xdisplay, screen->xroot,
-                                 screen->width,
-                                 screen->height,
-                                 DefaultDepth (xdisplay,
-                                               screen->number));
-
-  gc = XCreateGC (xdisplay, buffer_pixmap, 0, NULL);
-  XSetForeground (xdisplay, gc, WhitePixel (xdisplay, screen->number));
-  XFixesSetGCClipRegion (xdisplay, gc, 0, 0, region);
-  XFillRectangle (xdisplay, buffer_pixmap, gc, 0, 0,
-                  screen->width, screen->height);
-  
-  format = XRenderFindVisualFormat (xdisplay,
-                                    DefaultVisual (xdisplay,
+  if (screen->buffer_picture == None)
+    {
+      buffer_pixmap = XCreatePixmap (xdisplay, screen->xroot,
+                                     screen->width,
+                                     screen->height,
+                                     DefaultDepth (xdisplay,
                                                    screen->number));
-  
-  buffer_picture = XRenderCreatePicture (xdisplay,
-                                         buffer_pixmap,
-                                         format,
-                                         0, 0);
+
+      gc = XCreateGC (xdisplay, buffer_pixmap, 0, NULL);
+      XSetForeground (xdisplay, gc, WhitePixel (xdisplay, screen->number));
+      XFixesSetGCClipRegion (xdisplay, gc, 0, 0, region);
+      XFillRectangle (xdisplay, buffer_pixmap, gc, 0, 0,
+                      screen->width, screen->height);
+      
+      format = XRenderFindVisualFormat (xdisplay,
+                                        DefaultVisual (xdisplay,
+                                                       screen->number));
+      
+      screen->buffer_picture = XRenderCreatePicture (xdisplay,
+                                             buffer_pixmap,
+                                             format,
+                                             0, 0);
+      
+      XFreePixmap (xdisplay, buffer_pixmap);
+      XFreeGC (xdisplay, gc);
+    }
 
   /* set clip */          
   XFixesSetPictureClipRegion (xdisplay,
-                              buffer_picture, 0, 0,
+                              screen->buffer_picture, 0, 0,
                               region);
 
   /* draw windows from bottom to top */
@@ -426,7 +432,7 @@
                             PictOpOver, /* PictOpOver for alpha, PictOpSrc without */
                             cwindow->picture,
                             screen->trans_picture,
-                            buffer_picture,
+                            screen->buffer_picture,
                             0, 0, 0, 0,
                             x, y, w, h);
         }
@@ -439,7 +445,7 @@
           
           /* superlame drop shadow */
           XRenderFillRectangle (xdisplay, PictOpOver,
-                                buffer_picture,
+                                screen->buffer_picture,
                                 &shadow_color,
                                 cwindow->x + SHADOW_OFFSET,
                                 cwindow->y + SHADOW_OFFSET,
@@ -449,7 +455,7 @@
                             PictOpSrc, /* PictOpOver for alpha, PictOpSrc without */
                             cwindow->picture,
                             None,
-                            buffer_picture,
+                            screen->buffer_picture,
                             0, 0, 0, 0,
                             x, y, w, h);
         }
@@ -469,16 +475,16 @@
                               0, 0, region);
 #endif
   
-  /* XFixesSetPictureClipRegion (xdisplay, buffer_picture, 0, 0, None); */
-  XRenderComposite (xdisplay, PictOpSrc, buffer_picture, None,
+  /* XFixesSetPictureClipRegion (xdisplay, screen->buffer_picture, 0, 0, None); */
+  XRenderComposite (xdisplay, PictOpSrc, screen->buffer_picture, None,
                     screen->root_picture,
                     0, 0, 0, 0, 0, 0,
                     screen->width, screen->height);
   
   XFixesDestroyRegion (xdisplay, region);
-  XFreePixmap (xdisplay, buffer_pixmap);
-  XRenderFreePicture (xdisplay, buffer_picture);
-  XFreeGC (xdisplay, gc);
 
   /* meta_display_ungrab (screen->display); */
 
@@ -676,7 +716,18 @@
   cwindow = g_hash_table_lookup (compositor->window_hash,
                                  &event->window);
   if (cwindow == NULL)
-    return;
+    {
+      if (event->window == screen->xroot)
+        {
+          if (screen->buffer_picture != None)
+            {
+               XRenderFreePicture (compositor->display->xdisplay,
+                                   screen->buffer_picture);
+               screen->buffer_picture = None;
+            }
+        }
+      return;
+    }
 
   screen = meta_compositor_window_get_screen (cwindow);
 
diff -Naur metacity-2.10.1/src/screen.c metacity-2.10.1-change/src/screen.c
--- metacity-2.10.1/src/screen.c	2005-02-28 21:30:10.000000000 +0000
+++ metacity-2.10.1-change/src/screen.c	2005-06-27 22:13:22.000000000 +0100
@@ -544,6 +544,7 @@
   screen->root_picture = None;
   screen->trans_pixmap = None;
   screen->trans_picture = None;
+  screen->buffer_picture = None;
   
   {
     XGCValues gc_values;
diff -Naur metacity-2.10.1/src/screen.h metacity-2.10.1-change/src/screen.h
--- metacity-2.10.1/src/screen.h	2005-01-17 20:25:09.000000000 +0000
+++ metacity-2.10.1-change/src/screen.h	2005-06-27 22:13:18.000000000 +0100
@@ -120,6 +120,7 @@
   XID damage_region;
   XID trans_pixmap;
   XID trans_picture;
+  XID buffer_picture;
 };
 
 MetaScreen*   meta_screen_new                 (MetaDisplay                *display,
