[PATCH inputproto 2/4] XI2.1: Add confine_to to XIGrabDevice.

Peter Hutterer peter.hutterer at who-t.net
Thu Jun 2 00:13:28 PDT 2011


From: Philipp Reh <sefi at s-e-f-i.de>

Updated the specs for XIGrabDevice which now
sends an additional confine_to parameter after the mask.

The confine_to behaviour is the same as the core event behaviour: if the
device is a master pointer, the confine_to window determines the window the
cursor is confined to during the grab.

Changes in protocol behaviour to XI 2.0:
XIGrabDevice may return NotViewable if the confine_to is not viewable.

Signed-off-by: Philipp Reh <sefi at s-e-f-i.de>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
Changes to previous version:
- add note about NotViewable return code

 specs/XI2proto.txt |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/specs/XI2proto.txt b/specs/XI2proto.txt
index 5abf9d4..31c2647 100644
--- a/specs/XI2proto.txt
+++ b/specs/XI2proto.txt
@@ -39,6 +39,7 @@ device information in each event (with the exception of core events).
 Changes introduced by version 2.1
 
 - RawEvents are sent regardless of the grab state.
+- XIGrabDevice takes  a confine_to parameter
 
 //                            ❧❧❧❧❧❧❧❧❧❧❧
 
@@ -822,10 +823,13 @@ Return the current focus window for the given device.
             cursor:          Cursor
             mask_len:        CARD16
             masks:           SETofEVENTMASK
+            confine_to*:      Window
             ▶
             status:          Success, AlreadyGrabbed, Frozen, InvalidTime, NotViewable
     └───
 
+    * since XI 2.1
+
 This request actively grabs control of the specified input device. Further
 input events from this device are reported only to the grabbing client.
 This request overides any previous active grab by this client for this
@@ -851,6 +855,8 @@ device.
         Length of mask in 4 byte units.
     mask
         Event mask. An event mask for an event type T is defined as (1 << T).
+    confine_to
+        The window to confine the pointer to. Can be None.
     status
         Success or the reason why the grab could not be established.
 
@@ -887,10 +893,14 @@ devices are frozen; they are simply queued for later processing.
 If the cursor is not None and the device is a master pointer device, the
 cursor will be displayed until the device is ungrabbed.
 
+If the client supports XI 2.1 and confine_to is not None and the device is a
+master pointer device, the cursor will be confined to that window.
+
 This request fails and returns:
 
     AlreadyGrabbed: If the device is actively grabbed by some other client.
-    NotViewable: If grab-window is not viewable.
+    NotViewable: If grab-window or the confine_to window (if any) is not
+                 viewable.
     InvalidTime: If the specified time is earlier than the last-grab-time for
                  the specified device or later than the current X server time.
                  Otherwise, the last-grab-time for the specified device is set
-- 
1.7.5.1



More information about the xorg-devel mailing list