summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-04-16 11:37:20 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-04-20 13:37:21 +1000
commit3380ae0ac0220c7f8fea9df855113819b472a233 (patch)
treee0593c9096a36a7e651cfb697289b088f172fa14
parent3c273d7145ed5f53b54d2812ad2ac8430d449555 (diff)
Add XIAllowEvents.
Basically the same as the core protocol AllowEvents.
-rw-r--r--XI2.h7
-rw-r--r--XI2proto.h20
-rw-r--r--XI2proto.txt86
3 files changed, 112 insertions, 1 deletions
diff --git a/XI2.h b/XI2.h
index 8a87d89..e50db00 100644
--- a/XI2.h
+++ b/XI2.h
@@ -28,6 +28,13 @@
#define XI_2_Major 2
#define XI_2_Minor 0
+/* XIAllowEvents event-modes */
+#define AsyncDevice 0
+#define SyncDevice 1
+#define ReplayDevice 2
+#define AsyncPairedDevice 3
+#define AsyncPair 4
+#define SyncPair 5
/* DeviceChangedEvent change reasons */
#define SlaveSwitch 1
diff --git a/XI2proto.h b/XI2proto.h
index da41df2..4206d2d 100644
--- a/XI2proto.h
+++ b/XI2proto.h
@@ -57,8 +57,9 @@
#define X_XIGetDeviceFocus 50
#define X_XIGrabDevice 51
#define X_XIUngrabDevice 52
+#define X_XIAllowEvents 53
-#define XI2REQUESTS (X_XIUngrabDevice - X_XIQueryDevicePointer + 1)
+#define XI2REQUESTS (X_XIAllowEvents - X_XIQueryDevicePointer + 1)
#define XI2EVENTS (XI_LASTEVENT + 1)
/*************************************************************************************
@@ -539,6 +540,23 @@ typedef struct {
} xXIUngrabDeviceReq;
#define sz_xXIUngrabDeviceReq 12
+
+/**********************************************************
+ *
+ * AllowEvents
+ *
+ */
+typedef struct {
+ uint8_t reqType;
+ uint8_t ReqType; /* Always X_XIAllowEvents */
+ uint16_t length;
+ Time time;
+ uint16_t deviceid;
+ uint8_t mode;
+ uint8_t pad;
+} xXIAllowEventsReq;
+#define sz_xXIAllowEventsReq 12
+
/*************************************************************************************
* *
* EVENTS *
diff --git a/XI2proto.txt b/XI2proto.txt
index 4fbc716..cbf0ef7 100644
--- a/XI2proto.txt
+++ b/XI2proto.txt
@@ -704,6 +704,92 @@ XI2. Clients should ignore this data.
An XIUngrabDevice is performed automatically if the event window for an
active device grab becomes not viewable.
+ ┌───
+ XIAllowEvents:
+ deviceid: DEVICEID
+ time: TIMESTAMP or CurrentTime
+ event-mode: { AsyncDevice, SyncDevice,
+ AsyncPairedDevice, SyncPairedDevice,
+ ReplayDevice, AsyncPair, SyncPair }
+ └───
+
+ Errors: Device, Value
+
+ The AllowDeviceEvents request releases some queued events if the client
+ has caused a device to freeze. The request has no effect if the specified
+ time is earlier than the last-grab time of the most recent active grab for
+ the client, or if the specified time is later than the current X server
+ time.
+
+ The following describes the processing that occurs depending on what constant
+ you pass to the event-mode argument:
+ AsyncDevice:
+ If the specified device is frozen by the client, event processing for that
+ device continues as usual. If the device is frozen multiple times by the
+ client on behalf of multiple separate grabs, AsyncThisDevice thaws for
+ all.
+ AsyncDevice has no effect if the specified device is not frozen by the
+ client, but the device need not be grabbed by the client.
+ SyncDevice:
+ If the specified device is frozen and actively grabbed by the client,
+ event processing for that device continues normally until the next
+ event is reported to the client. At this time, the specified device
+ again appears to freeze. However, if the reported event causes the
+ grab to be released, the specified device does not freeze.
+ SyncDevice has no effect if the specified device is not frozen by the
+ client or is not grabbed by the client.
+ ReplayDevice:
+ If the specified device is actively grabbed by the client and is frozen
+ as the result of an event having been sent to the client (either from
+ the activation of a XIGrabButton or from a previous XIAllowEvents with
+ mode SyncDevice, but not from a Grab), the grab is released and
+ that event is completely reprocessed. This time, however, the request
+ ignores any passive grabs at or above (towards the root) the
+ grab-window of the grab just released.
+ The request has no effect if the specified device is not grabbed by
+ the client or if it is not frozen as the result of an event.
+ AsyncPairedDevice
+ If the paired master device is frozen by the client, event processing
+ for it continues as usual. If the paired device is frozen multiple
+ times by the client on behalf of multiple separate grabs,
+ AsyncPairedDevice thaws for all.
+ AsyncPairedDevice has no effect if the device is not frozen by the
+ client, but those devices need not be grabbed by the client.
+ AsyncPairedDevice has no effect if deviceid specifies a slave device.
+ SyncPairedDevice
+ If the paired master device is frozen by the client, event processing (for
+ the paired master device) continues normally until the next button or key
+ event is reported to the client for the grabbed device (button event for
+ the grabbed device, key or motion event for the device), at which time
+ the device again appears to freeze. However, if the reported event causes
+ the grab to be released, then the device does not freeze.
+ SyncPairedDevice has no effect if the specified device is not grabbed
+ by the client or if it is no frozen as the result of an event.
+ SyncPairedDevice has no effect if deviceid specifies a slave device.
+ SyncPair
+ If both the device and the paired master device are frozen by the
+ client, event processing (for both devices) continues normally until
+ the next XIButtonPress, XIButtonRelease, XIKeyPress, or XIKeyRelease
+ event is reported to the client for a grabbed device (button event for
+ a pointer, key event for a keyboard), at which time the devices again
+ appear to freeze. However, if the reported event causes the grab to be
+ released, then the devices do not freeze (but if the other device is
+ still grabbed, then a subsequent event for it will still cause both
+ devices to freeze).
+ SyncPair has no effect unless both the device and the paired master
+ device are frozen by the client. If the device or paired master device
+ is frozen twice by the client on behalf of two separate grabs,
+ SyncPair thaws for both (but a subsequent freeze for SyncPair will
+ only freeze each device once).
+ SyncPair has no effect if deviceid specifies a slave device.
+ AsyncPair
+ If the device and the paired master device are frozen by the client,
+ event processing for both devices continues normally. If a device is
+ frozen twice by the client on behalf of two separate grabs, AsyncBoth
+ thaws for both. AsyncPair has no effect unless both the device and the
+ paired master device frozen by the client.
+ AsyncPair has no effect if deviceid specifies a slave device.
+
8. Events:
An event specifies its length in 4-byte units after the initial 32 bytes.