[Xcb] [PATCH proto 3/5] xinput: rep SetDeviceMode.status: altenum to enum

Christian Linhart chris at demorecorder.com
Mon Aug 18 07:41:21 PDT 2014

Field "status" of the SetDeviceMode-reply
only allows values from enum GrabStatus.

Therefore it has an "enum" and not an "altenum".

Also: Add comment about valid values of field "status".


The following spec also mentions value "3 + first_error":

This is probably an error in this old spec because:
* the X-Server code does not generate that value.
  In case of error-codes, it does the following:
  instead of sending the reply it returns
  rep.status containing the error-code as returnvalue
  of the function ProcXSetDeviceMode.
  This will probably cause the sending of an XError.

* the new spec does not mention that value:
 src/xinput.xml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/xinput.xml b/src/xinput.xml
index b88e3ad..b55ce3a 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -205,15 +205,16 @@ <request name="CloseDevice" opcode="4">
     <request name="SetDeviceMode" opcode="5">
         <field type="CARD8" name="device_id" />
         <field type="CARD8" name="mode" enum="ValuatorMode" />
         <pad bytes="2" />
             <pad bytes="1" />
-            <field type="CARD8" name="status" altenum="GrabStatus" />
+            <!-- values for status: 0: Success, 1: AlreadyGrabbed -->
+            <field type="CARD8" name="status" enum="GrabStatus" />
             <pad bytes="23" />
     <!-- SelectExtensionEvent -->
     <request name="SelectExtensionEvent" opcode="6">

More information about the Xcb mailing list