diff options
author | Povilas Kanapickas <povilas@radix.lt> | 2021-05-30 13:26:32 +0300 |
---|---|---|
committer | Povilas Kanapickas <povilas@radix.lt> | 2021-05-30 13:26:32 +0300 |
commit | 080bac39c844bd16b7e1493797c6e7644badf0ab (patch) | |
tree | 4dbf02b574824b42fe6910917a313fa0f28739fc /Xi | |
parent | b544a1fdb8fa7e7efc7dde66089e901d957061d9 (diff) |
xi: Implement grab support for new gesture event types
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/exevents.c | 6 | ||||
-rw-r--r-- | Xi/xipassivegrab.c | 29 |
2 files changed, 28 insertions, 7 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index c8751ce18..83ea387ab 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -2427,8 +2427,8 @@ GrabWindow(ClientPtr client, DeviceIntPtr dev, int type, /* Touch grab */ int -GrabTouch(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr mod_dev, - GrabParameters *param, GrabMask *mask) +GrabTouchOrGesture(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr mod_dev, + int type, GrabParameters *param, GrabMask *mask) { WindowPtr pWin; GrabPtr grab; @@ -2446,7 +2446,7 @@ GrabTouch(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr mod_dev, return rc; grab = CreateGrab(client->index, dev, mod_dev, pWin, XI2, - mask, param, XI_TouchBegin, 0, NullWindow, NullCursor); + mask, param, type, 0, NullWindow, NullCursor); if (!grab) return BadAlloc; diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index d30f51f3c..2769fb7c9 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -114,14 +114,18 @@ ProcXIPassiveGrabDevice(ClientPtr client) stuff->grab_type != XIGrabtypeKeycode && stuff->grab_type != XIGrabtypeEnter && stuff->grab_type != XIGrabtypeFocusIn && - stuff->grab_type != XIGrabtypeTouchBegin) { + stuff->grab_type != XIGrabtypeTouchBegin && + stuff->grab_type != XIGrabtypeGesturePinchBegin && + stuff->grab_type != XIGrabtypeGestureSwipeBegin) { client->errorValue = stuff->grab_type; return BadValue; } if ((stuff->grab_type == XIGrabtypeEnter || stuff->grab_type == XIGrabtypeFocusIn || - stuff->grab_type == XIGrabtypeTouchBegin) && stuff->detail != 0) { + stuff->grab_type == XIGrabtypeTouchBegin || + stuff->grab_type == XIGrabtypeGesturePinchBegin || + stuff->grab_type == XIGrabtypeGestureSwipeBegin) && stuff->detail != 0) { client->errorValue = stuff->detail; return BadValue; } @@ -217,7 +221,16 @@ ProcXIPassiveGrabDevice(ClientPtr client) status = GrabWindow(client, dev, stuff->grab_type, ¶m, &mask); break; case XIGrabtypeTouchBegin: - status = GrabTouch(client, dev, mod_dev, ¶m, &mask); + status = GrabTouchOrGesture(client, dev, mod_dev, XI_TouchBegin, + ¶m, &mask); + break; + case XIGrabtypeGesturePinchBegin: + status = GrabTouchOrGesture(client, dev, mod_dev, + XI_GesturePinchBegin, ¶m, &mask); + break; + case XIGrabtypeGestureSwipeBegin: + status = GrabTouchOrGesture(client, dev, mod_dev, + XI_GestureSwipeBegin, ¶m, &mask); break; } @@ -307,7 +320,9 @@ ProcXIPassiveUngrabDevice(ClientPtr client) stuff->grab_type != XIGrabtypeKeycode && stuff->grab_type != XIGrabtypeEnter && stuff->grab_type != XIGrabtypeFocusIn && - stuff->grab_type != XIGrabtypeTouchBegin) { + stuff->grab_type != XIGrabtypeTouchBegin && + stuff->grab_type != XIGrabtypeGesturePinchBegin && + stuff->grab_type != XIGrabtypeGestureSwipeBegin) { client->errorValue = stuff->grab_type; return BadValue; } @@ -348,6 +363,12 @@ ProcXIPassiveUngrabDevice(ClientPtr client) case XIGrabtypeTouchBegin: tempGrab->type = XI_TouchBegin; break; + case XIGrabtypeGesturePinchBegin: + tempGrab->type = XI_GesturePinchBegin; + break; + case XIGrabtypeGestureSwipeBegin: + tempGrab->type = XI_GestureSwipeBegin; + break; } tempGrab->grabtype = XI2; tempGrab->modifierDevice = mod_dev; |