summaryrefslogtreecommitdiff
path: root/src/XIPassiveGrab.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-09-14 22:33:57 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2011-12-21 15:32:05 +1000
commite73e2fe95dab3e0048b24d16327adbe54326ff3f (patch)
tree8189d07cfc14fd6eabbfc343faa1157a665e9bad /src/XIPassiveGrab.c
parent7888d14a499062a1c3b333f31f1330cecf1e97c1 (diff)
Implement support for XI 2.2
Adds support for the new TouchClass for multitouch-capable servers/devices. New events: XITouchOwnershipEvent New event types handled: XITouchBegin, XITouchUpdate, XITouchEnd XIRawTouchBegin, XIRawTouchUpdate, XIRawTouchEnd New functions: XIGrabTouchBegin ... passive grabs on touches XIUngrabTouchBegin XIAllowTouchEvents ... Allow/reject touch event sequences New XIQueryDevice classes: XITouchClassInfo Requires libX11 1.5 for GetReqSized Co-authored by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/XIPassiveGrab.c')
-rw-r--r--src/XIPassiveGrab.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/XIPassiveGrab.c b/src/XIPassiveGrab.c
index 7625521..ac17c01 100644
--- a/src/XIPassiveGrab.c
+++ b/src/XIPassiveGrab.c
@@ -148,6 +148,25 @@ XIGrabFocusIn(Display *dpy, int deviceid, Window grab_window, int grab_mode,
modifiers_inout);
}
+int
+XIGrabTouchBegin(Display *dpy, int deviceid, Window grab_window,
+ Bool owner_events, XIEventMask *mask,
+ int num_modifiers, XIGrabModifiers *modifiers_inout)
+{
+ XExtDisplayInfo *extinfo = XInput_find_display(dpy);
+
+ LockDisplay(dpy);
+ if (_XiCheckExtInit(dpy, XInput_2_2, extinfo) == -1)
+ return -1;
+
+ /* FIXME: allow selection of GrabMode for paired devices? */
+ return _XIPassiveGrabDevice(dpy, deviceid, XIGrabtypeTouchBegin, 0,
+ grab_window, None, XIGrabModeTouch,
+ GrabModeAsync, owner_events, mask,
+ num_modifiers, modifiers_inout);
+}
+
+
static int
_XIPassiveUngrabDevice(Display* dpy, int deviceid, int grabtype, int detail,
Window grab_window, int num_modifiers, XIGrabModifiers *modifiers)
@@ -211,3 +230,17 @@ XIUngrabFocusIn(Display* display, int deviceid, Window grab_window,
return _XIPassiveUngrabDevice(display, deviceid, XIGrabtypeFocusIn, 0,
grab_window, num_modifiers, modifiers);
}
+
+int
+XIUngrabTouchBegin(Display* display, int deviceid, Window grab_window,
+ int num_modifiers, XIGrabModifiers *modifiers)
+{
+ XExtDisplayInfo *extinfo = XInput_find_display(display);
+
+ LockDisplay(display);
+ if (_XiCheckExtInit(display, XInput_2_2, extinfo) == -1)
+ return -1;
+
+ return _XIPassiveUngrabDevice(display, deviceid, XIGrabtypeTouchBegin, 0,
+ grab_window, num_modifiers, modifiers);
+}