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>
(cherry picked from commit 5b169cb695)
This commit is contained in:
Carlos Garnacho 2011-12-13 15:41:23 +01:00 committed by Jeremy Huddleston
parent 4b39a4be11
commit 977ea84992

View File

@ -140,11 +140,17 @@ ProcXIPassiveGrabDevice(ClientPtr client)
memset(&param, 0, sizeof(param));
param.grabtype = 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)
{
status = dixLookupResourceByType(&tmp, stuff->cursor,