diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2011-12-13 15:41:23 +0100 |
---|---|---|
committer | Chase Douglas <chase.douglas@canonical.com> | 2011-12-21 10:34:12 -0800 |
commit | e48a38d74ba8c415729801dbb3a16a3c372d4886 (patch) | |
tree | 82555a859a975f1600bdcfa13a994cd08806aea7 | |
parent | b6a3a440700d005aeceec96bc2562e7f8a1b724e (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>
-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, |