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

This commit is contained in:
Carlos Garnacho 2011-07-03 21:06:55 +02:00
parent 656fa71649
commit 5ecbb3ec3b

View File

@ -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,11 +1249,10 @@ primary_modifier_still_pressed (MetaDisplay *display,
random_screen = display->screens->data;
random_xwindow = random_screen->no_focus_window;
XQueryPointer (display->xdisplay,
meta_device_pointer_query_position (META_DEVICE_POINTER (device),
random_xwindow, /* some random window */
&root, &child,
&root_x, &root_y,
&x, &y,
NULL, NULL, NULL,
NULL, NULL, NULL,
&mask);
meta_topic (META_DEBUG_KEYBINDINGS,
@ -3253,7 +3252,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
@ -3672,7 +3671,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");