Blob Blame History Raw
Index: src/display.c
===================================================================
RCS file: /cvs/gnome/metacity/src/display.c,v
retrieving revision 1.288
diff -p -u -r1.288 display.c
--- src/display.c	21 Aug 2006 18:38:21 -0000	1.288
+++ src/display.c	9 Sep 2006 18:55:33 -0000
@@ -3323,7 +3323,7 @@ meta_display_begin_grab_op (MetaDisplay 
 
       else
         display->grab_have_keyboard =
-                     meta_screen_grab_all_keys (screen);
+                     meta_screen_grab_all_keys (screen, timestamp);
       
       if (!display->grab_have_keyboard)
         {
@@ -3618,9 +3618,9 @@ meta_display_end_grab_op (MetaDisplay *d
       meta_topic (META_DEBUG_WINDOW_OPS,
                   "Ungrabbing all keys timestamp %lu\n", timestamp);
       if (display->grab_window)
-        meta_window_ungrab_all_keys (display->grab_window);
+        meta_window_ungrab_all_keys (display->grab_window, timestamp);
       else
-        meta_screen_ungrab_all_keys (display->grab_screen);
+        meta_screen_ungrab_all_keys (display->grab_screen, timestamp);
     }
 
 #ifdef HAVE_XSYNC
Index: src/keybindings.c
===================================================================
RCS file: /cvs/gnome/metacity/src/keybindings.c,v
retrieving revision 1.132
diff -p -u -r1.132 keybindings.c
--- src/keybindings.c	21 Aug 2006 19:06:25 -0000	1.132
+++ src/keybindings.c	9 Sep 2006 18:55:33 -0000
@@ -1208,18 +1208,17 @@ grab_status_to_string (int status)
 
 static gboolean
 grab_keyboard (MetaDisplay *display,
-               Window       xwindow)
+               Window       xwindow,
+               Time         timestamp)
 {
   int result;
   int grab_status;
-  Time timestamp;
   
   /* Grab the keyboard, so we get key releases and all key
    * presses
    */
   meta_error_trap_push_with_return (display);
 
-  timestamp = meta_display_get_current_time (display);
   grab_status = XGrabKeyboard (display->xdisplay,
                                xwindow, True,
                                GrabModeAsync, GrabModeAsync,
@@ -1251,12 +1250,8 @@ grab_keyboard (MetaDisplay *display,
 }
 
 static void
-ungrab_keyboard (MetaDisplay *display)
+ungrab_keyboard (MetaDisplay *display, Time timestamp)
 {
-  Time timestamp;
-
-  timestamp = meta_display_get_current_time (display);
-      
   meta_error_trap_push (display);
 
   meta_topic (META_DEBUG_KEYBINDINGS,
@@ -1267,7 +1262,7 @@ ungrab_keyboard (MetaDisplay *display)
 }
 
 gboolean
-meta_screen_grab_all_keys (MetaScreen *screen)
+meta_screen_grab_all_keys (MetaScreen *screen, Time timestamp)
 {
   gboolean retval;
 
@@ -1279,7 +1274,7 @@ meta_screen_grab_all_keys (MetaScreen *s
 
   meta_topic (META_DEBUG_KEYBINDINGS,
               "Grabbing all keys on RootWindow\n");
-  retval = grab_keyboard (screen->display, screen->xroot);
+  retval = grab_keyboard (screen->display, screen->xroot, timestamp);
   if (retval)
     screen->all_keys_grabbed = TRUE;
   else
@@ -1289,11 +1284,11 @@ meta_screen_grab_all_keys (MetaScreen *s
 }
 
 void
-meta_screen_ungrab_all_keys (MetaScreen *screen)
+meta_screen_ungrab_all_keys (MetaScreen *screen, Time timestamp)
 {
   if (screen->all_keys_grabbed)
     {
-      ungrab_keyboard (screen->display);
+      ungrab_keyboard (screen->display, timestamp);
 
       screen->all_keys_grabbed = FALSE;
       screen->keys_grabbed = FALSE;
@@ -1328,7 +1323,7 @@ meta_window_grab_all_keys (MetaWindow  *
 
   meta_topic (META_DEBUG_KEYBINDINGS,
               "Grabbing all keys on window %s\n", window->desc);
-  retval = grab_keyboard (window->display, grabwindow);
+  retval = grab_keyboard (window->display, grabwindow, timestamp);
   if (retval)
     {
       window->keys_grabbed = FALSE;
@@ -1340,11 +1335,11 @@ meta_window_grab_all_keys (MetaWindow  *
 }
 
 void
-meta_window_ungrab_all_keys (MetaWindow *window)
+meta_window_ungrab_all_keys (MetaWindow *window, Time timestamp)
 {
   if (window->all_keys_grabbed)
     {
-      ungrab_keyboard (window->display);
+      ungrab_keyboard (window->display, timestamp);
 
       window->grab_on_frame = FALSE;
       window->all_keys_grabbed = FALSE;
Index: src/keybindings.h
===================================================================
RCS file: /cvs/gnome/metacity/src/keybindings.h,v
retrieving revision 1.8
diff -p -u -r1.8 keybindings.h
--- src/keybindings.h	21 Aug 2006 18:38:21 -0000	1.8
+++ src/keybindings.h	9 Sep 2006 18:55:33 -0000
@@ -29,13 +29,16 @@ void     meta_display_init_keys         
 void     meta_display_shutdown_keys         (MetaDisplay *display);
 void     meta_screen_grab_keys              (MetaScreen  *screen);
 void     meta_screen_ungrab_keys            (MetaScreen  *screen);
-gboolean meta_screen_grab_all_keys          (MetaScreen *screen);
-void     meta_screen_ungrab_all_keys        (MetaScreen *screen);
+gboolean meta_screen_grab_all_keys          (MetaScreen *screen,
+                                             Time timestamp);
+void     meta_screen_ungrab_all_keys        (MetaScreen *screen, 
+                                             Time timestamp);
 void     meta_window_grab_keys              (MetaWindow  *window);
 void     meta_window_ungrab_keys            (MetaWindow  *window);
 gboolean meta_window_grab_all_keys          (MetaWindow  *window,
                                              Time         timestamp);
-void     meta_window_ungrab_all_keys        (MetaWindow  *window);
+void     meta_window_ungrab_all_keys        (MetaWindow  *window,
+                                             Time         timestamp);
 void     meta_display_process_key_event     (MetaDisplay *display,
                                              MetaWindow  *window,
                                              XEvent      *event);