From 93c2a1628a9f6e7480d834bf55c080997fd18911 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 14 Dec 2011 13:51:12 +1000 Subject: Hook up the ownership events This patch applies most of the protocol conversions and the internal event type for ownership events. Note that ownership events are generated by the DIX only, they do not pass through the event queue. Co-authored-by: Daniel Stone Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas --- include/events.h | 1 + include/eventstr.h | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'include') diff --git a/include/events.h b/include/events.h index 375173adc..222cc3d19 100644 --- a/include/events.h +++ b/include/events.h @@ -26,6 +26,7 @@ #define EVENTS_H typedef struct _DeviceEvent DeviceEvent; typedef struct _DeviceChangedEvent DeviceChangedEvent; +typedef struct _TouchOwnershipEvent TouchOwnershipEvent; #if XFreeXDGA typedef struct _DGAEvent DGAEvent; #endif diff --git a/include/eventstr.h b/include/eventstr.h index 332307374..e4410a79f 100644 --- a/include/eventstr.h +++ b/include/eventstr.h @@ -53,6 +53,7 @@ enum EventType { ET_TouchBegin, ET_TouchUpdate, ET_TouchEnd, + ET_TouchOwnership, ET_Enter, ET_Leave, ET_FocusIn, @@ -123,6 +124,24 @@ struct _DeviceEvent uint32_t flags; /**< Flags to be copied into the generated event */ }; +/** + * Generated internally whenever a touch ownership chain changes - an owner + * has accepted or rejected a touch, or a grab/event selection in the delivery + * chain has been removed. + */ +struct _TouchOwnershipEvent +{ + unsigned char header; /**< Always ET_Internal */ + enum EventType type; /**< One of EventType */ + int length; /**< Length in bytes */ + Time time; /**< Time in ms */ + int deviceid; /**< Device to post this event for */ + int sourceid; /**< The physical source device */ + uint32_t touchid; /**< Touch ID (client_id) */ + uint8_t reason; /**< ::XIAcceptTouch, ::XIRejectTouch */ + uint32_t resource; /**< Provoking grab or event selection */ + uint32_t flags; /**< Flags to be copied into the generated event */ +}; /* Flags used in DeviceChangedEvent to signal if the slave has changed */ #define DEVCHANGE_SLAVE_SWITCH 0x2 @@ -238,6 +257,7 @@ union _InternalEvent { } any; DeviceEvent device_event; DeviceChangedEvent changed_event; + TouchOwnershipEvent touch_ownership_event; #if XFreeXDGA DGAEvent dga_event; #endif -- cgit v1.2.3