summaryrefslogtreecommitdiff
path: root/src/XIAllowEvents.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/XIAllowEvents.c')
-rw-r--r--src/XIAllowEvents.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/XIAllowEvents.c b/src/XIAllowEvents.c
index 75980a0..00229c9 100644
--- a/src/XIAllowEvents.c
+++ b/src/XIAllowEvents.c
@@ -51,3 +51,32 @@ XIAllowEvents(Display *dpy, int deviceid, int event_mode, Time time)
SyncHandle();
return Success;
}
+
+Status
+XIAllowTouchEvents(Display *dpy, int deviceid, int event_mode, Time time,
+ uint32_t touchid)
+{
+ xXIAllowEventsDetailReq *req;
+
+ XExtDisplayInfo *extinfo = XInput_find_display(dpy);
+
+ LockDisplay(dpy);
+ if (_XiCheckExtInit(dpy, XInput_2_1, extinfo) == -1)
+ return (NoSuchExtension);
+
+ /* Xlib really wants the struct and req names to be the same. */
+#define X_XIAllowEventsDetail X_XIAllowEvents
+ GetReq(XIAllowEventsDetail, req);
+#undef X_XIAllowEventsDetail
+
+ req->reqType = extinfo->codes->major_opcode;
+ req->ReqType = X_XIAllowEvents;
+ req->deviceid = deviceid;
+ req->mode = event_mode;
+ req->time = time;
+ req->detail = touchid;
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return Success;
+}