summaryrefslogtreecommitdiff
path: root/src/XIPassiveGrab.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-12-21 15:40:37 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-12-21 15:40:37 +1000
commit47f3d887a7731f4ab68a69ed31dbe7acf6d13270 (patch)
tree8189d07cfc14fd6eabbfc343faa1157a665e9bad /src/XIPassiveGrab.c
parent82a631263ef4e6f46c1f33748089db8bf603b095 (diff)
parente73e2fe95dab3e0048b24d16327adbe54326ff3f (diff)
Merge branch 'multitouch'
Conflicts: configure.ac
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);
+}