diff options
Diffstat (limited to 'xorg-server/Xi/xipassivegrab.c')
-rw-r--r-- | xorg-server/Xi/xipassivegrab.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/xorg-server/Xi/xipassivegrab.c b/xorg-server/Xi/xipassivegrab.c index 713a1654e..c80da8044 100644 --- a/xorg-server/Xi/xipassivegrab.c +++ b/xorg-server/Xi/xipassivegrab.c @@ -108,19 +108,29 @@ ProcXIPassiveGrabDevice(ClientPtr client) if (stuff->grab_type != XIGrabtypeButton && stuff->grab_type != XIGrabtypeKeycode && stuff->grab_type != XIGrabtypeEnter && - stuff->grab_type != XIGrabtypeFocusIn) + stuff->grab_type != XIGrabtypeFocusIn && + stuff->grab_type != XIGrabtypeTouchBegin) { client->errorValue = stuff->grab_type; return BadValue; } if ((stuff->grab_type == XIGrabtypeEnter || - stuff->grab_type == XIGrabtypeFocusIn) && stuff->detail != 0) + stuff->grab_type == XIGrabtypeFocusIn || + stuff->grab_type == XIGrabtypeTouchBegin) && stuff->detail != 0) { client->errorValue = stuff->detail; return BadValue; } + if (stuff->grab_type == XIGrabtypeTouchBegin && + (stuff->grab_mode != XIGrabModeTouch || + stuff->paired_device_mode != GrabModeAsync)) + { + client->errorValue = stuff->grab_mode; + return BadValue; + } + if (XICheckInvalidMaskBits(client, (unsigned char*)&stuff[1], stuff->mask_len * 4) != Success) return BadValue; @@ -141,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, @@ -194,6 +210,9 @@ ProcXIPassiveGrabDevice(ClientPtr client) status = GrabWindow(client, dev, stuff->grab_type, ¶m, &mask); break; + case XIGrabtypeTouchBegin: + status = GrabTouch(client, dev, mod_dev, ¶m, &mask); + break; } if (status != GrabSuccess) |