[mutter/wip/multitouch: 38/73] keybindings: use the right device for querying the modifier mask.



commit 61b120d08c8ecedbc26003690c9102be66bd1636
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Jul 3 21:06:55 2011 +0200

    keybindings: use the right device for querying the modifier mask.

 src/core/keybindings.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index b3b6d9e..510f38b 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -35,6 +35,7 @@
 #include "frame.h"
 #include "place.h"
 #include "input-events.h"
+#include "device-pointer.h"
 #include <meta/prefs.h>
 #include <meta/util.h>
 
@@ -1236,11 +1237,10 @@ keycode_is_primary_modifier (MetaDisplay *display,
 
 static gboolean
 primary_modifier_still_pressed (MetaDisplay *display,
+                                MetaDevice  *device,
                                 unsigned int entire_binding_mask)
 {
   unsigned int primary_modifier;
-  int x, y, root_x, root_y;
-  Window root, child;
   guint mask;
   MetaScreen *random_screen;
   Window      random_xwindow;
@@ -1249,12 +1249,11 @@ primary_modifier_still_pressed (MetaDisplay *display,
   
   random_screen = display->screens->data;
   random_xwindow = random_screen->no_focus_window;
-  XQueryPointer (display->xdisplay,
-                 random_xwindow, /* some random window */
-                 &root, &child,
-                 &root_x, &root_y,
-                 &x, &y,
-                 &mask);
+  meta_device_pointer_query_position (META_DEVICE_POINTER (device),
+                                      random_xwindow, /* some random window */
+                                      NULL, NULL, NULL,
+                                      NULL, NULL, NULL,
+                                      &mask);
 
   meta_topic (META_DEBUG_KEYBINDINGS,
               "Primary modifier 0x%x full grab mask 0x%x current state 0x%x\n",
@@ -3314,7 +3313,7 @@ do_choose_window (MetaDisplay    *display,
                                    0, 0))
     return;
 
-  if (!primary_modifier_still_pressed (display, binding->mask))
+  if (!primary_modifier_still_pressed (display, device, binding->mask))
     {
       /* This handles a race where modifier might be released before
        * we establish the grab. must end grab prior to trying to focus
@@ -3733,7 +3732,8 @@ handle_workspace_switch  (MetaDisplay    *display,
   next = meta_workspace_get_neighbor (screen->active_workspace, motion);
   g_assert (next); 
 
-  grabbed_before_release = primary_modifier_still_pressed (display, grab_mask);
+  grabbed_before_release = primary_modifier_still_pressed (display, device,
+                                                           grab_mask);
 
   meta_topic (META_DEBUG_KEYBINDINGS, "Activating target workspace\n");
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]