Index: src/window.c
===================================================================
RCS file: /cvs/gnome/metacity/src/window.c,v
retrieving revision 1.345
diff -p -u -r1.345 window.c
--- src/window.c	15 Sep 2004 15:54:51 -0000	1.345
+++ src/window.c	3 Oct 2004 15:57:08 -0000
@@ -7125,15 +7125,21 @@ warp_grab_pointer (MetaWindow          *
   
   meta_error_trap_push_with_return (window->display);
 
-  meta_topic (META_DEBUG_WINDOW_OPS,
-              "Warping pointer to %d,%d with window at %d,%d\n",
-              *x, *y, rect.x, rect.y);
+  if (*x > 0 &&
+      *y > 0 &&
+      *x < window->screen->width &&
+      *y < window->screen->height)
+    {
+      meta_topic (META_DEBUG_WINDOW_OPS,
+                  "Warping pointer to %d,%d with window at %d,%d\n",
+                  *x, *y, rect.x, rect.y);
   
-  XWarpPointer (window->display->xdisplay,
-                None,
-                window->screen->xroot,
-                0, 0, 0, 0, 
-                *x, *y);
+      XWarpPointer (window->display->xdisplay,
+                    None,
+                    window->screen->xroot,
+                    0, 0, 0, 0, 
+                    *x, *y);
+    }
 
   if (meta_error_trap_pop_with_return (window->display, FALSE) != Success)
     {
