summaryrefslogtreecommitdiff
path: root/dix/getevents.c
diff options
context:
space:
mode:
Diffstat (limited to 'dix/getevents.c')
-rw-r--r--dix/getevents.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/dix/getevents.c b/dix/getevents.c
index 39f8ca7b6..b38928187 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -156,6 +156,17 @@ key_autorepeats(DeviceIntPtr pDev, int key_code)
}
static void
+init_touch_ownership(DeviceIntPtr dev, TouchOwnershipEvent *event, Time ms)
+{
+ memset(event, 0, sizeof(TouchOwnershipEvent));
+ event->header = ET_Internal;
+ event->type = ET_TouchOwnership;
+ event->length = sizeof(TouchOwnershipEvent);
+ event->time = ms;
+ event->deviceid = dev->id;
+}
+
+static void
init_raw(DeviceIntPtr dev, RawDeviceEvent *event, Time ms, int type, int detail)
{
memset(event, 0, sizeof(RawDeviceEvent));
@@ -1631,6 +1642,30 @@ GetProximityEvents(InternalEvent *events, DeviceIntPtr pDev, int type, const Val
return num_events;
}
+int
+GetTouchOwnershipEvents(InternalEvent *events, DeviceIntPtr pDev,
+ TouchPointInfoPtr ti, uint8_t reason, XID resource,
+ uint32_t flags)
+{
+ TouchClassPtr t = pDev->touch;
+ TouchOwnershipEvent *event;
+ CARD32 ms = GetTimeInMillis();
+
+ if (!pDev->enabled || !t || !ti)
+ return 0;
+
+ event = &events->touch_ownership_event;
+ init_touch_ownership(pDev, event, ms);
+
+ event->touchid = ti->client_id;
+ event->sourceid = ti->sourceid;
+ event->resource = resource;
+ event->flags = flags;
+ event->reason = reason;
+
+ return 1;
+}
+
/**
* Generate internal events representing this touch event and enqueue them
* on the event queue.