--- metacity-2.15.5-jun6-2006/src/display.c~	2006-07-02 13:37:30.000000000 +0200
+++ metacity-2.15.5-jun6-2006/src/display.c	2006-07-02 13:39:51.000000000 +0200
@@ -3178,27 +3178,31 @@
     }
   else
     {
+      int attempts = 5;
       g_assert (screen != NULL);
 
       meta_error_trap_push (display);
-      if (XGrabPointer (display->xdisplay,
+      while (attempts && XGrabPointer (display->xdisplay,
                         grab_xwindow,
                         False,
                         GRAB_MASK,
                         GrabModeAsync, GrabModeAsync,
                         screen->xroot,
                         cursor,
-                        timestamp) == GrabSuccess)
+                        timestamp) != GrabSuccess)
         {
-          display->grab_have_pointer = TRUE;
           meta_topic (META_DEBUG_WINDOW_OPS,
-                      "XGrabPointer() returned GrabSuccess time 0x%lu\n",
+                      "XGrabPointer() failed time 0x%lu\n",
                       timestamp);
+          attempts--;
+          usleep(10000);
         }
-      else
+      /* success? */
+      if (attempts)
         {
+          display->grab_have_pointer = TRUE;
           meta_topic (META_DEBUG_WINDOW_OPS,
-                      "XGrabPointer() failed time 0x%lu\n",
+                      "XGrabPointer() returned GrabSuccess time 0x%lu\n",
                       timestamp);
         }
       meta_error_trap_pop (display, TRUE);
