diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2011-12-13 15:41:23 +0100 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-12-21 14:16:36 +1000 |
commit | 5b169cb695bd450d7f64e3800f00c9237ee67f96 (patch) | |
tree | 726a4dfc9125827899b5c3bebf0df0b431b13470 /Xi/xipassivegrab.c | |
parent | 4469430b109fa2da7ba3d2fadf66eca78b7156a0 (diff) |
Xi: assign correct grab_mode/other_device_mode in XI2 passive grabs
CreateGrab() expects the keyboard mode to be stored in grab_mode, and the
pointer mode in other_device_mode, so respect this in passive XI2 grabs,
and switch modes if needed.
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'Xi/xipassivegrab.c')
-rw-r--r-- | Xi/xipassivegrab.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index 5d34abc18..c80da8044 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -151,11 +151,17 @@ ProcXIPassiveGrabDevice(ClientPtr client) memset(¶m, 0, sizeof(param)); param.grabtype = XI2; param.ownerEvents = stuff->owner_events; - param.this_device_mode = stuff->grab_mode; - param.other_devices_mode = stuff->paired_device_mode; param.grabWindow = stuff->grab_window; param.cursor = stuff->cursor; + if (IsKeyboardDevice(dev)) { + param.this_device_mode = stuff->grab_mode; + param.other_devices_mode = stuff->paired_device_mode; + } else { + param.this_device_mode = stuff->paired_device_mode; + param.other_devices_mode = stuff->grab_mode; + } + if (stuff->cursor != None) { ret = dixLookupResourceByType(&tmp, stuff->cursor, |