[Xcb] [PATCH proto xkb] Fixes for xkb.xml

Ran Benita ran234 at gmail.com
Tue Feb 11 21:02:00 CET 2014


On Tue, Feb 11, 2014 at 05:50:25PM +0100, Christian Linhart wrote:
> Hi Ran,
> 
> Here's the patch again generated with 'git format-patch' and a short subject line. Attached to this email.
> (Thank you for pointing out how to make well-formatted patches.)

Thanks, it is fine now. See comments below.

> Chris
> 
> 
> 
> On 02/10/14 20:59, Ran Benita wrote:
> >The indentation in the diff is broken, which makes it hard to follow. If it's your mailer's doing, you can attach it instead. It would be even better if you generate the patch with 'git format-patch', adding a commit message, etc. Then it is also easier to apply. If you are not familiar with git we can give you pointers. Ran
> 

> From 29a885d4310ab1e8626abbca14dc60af79365371 Mon Sep 17 00:00:00 2001
> From: Christian Linhart <chris at demorecorder.com>
> Date: Tue, 11 Feb 2014 15:39:51 +0100
> Subject: [PATCH] xkb protocol fixes and reenable features
> 
> * remove keymapsSpec from the requests ListComponents and GetKbdByName
> * reenable previously commented-out features such as Doodads
> ---
>  src/xkb.xml |   41 +++--------------------------------------
>  1 file changed, 3 insertions(+), 38 deletions(-)
> 
> diff --git a/src/xkb.xml b/src/xkb.xml
> index 9ef4402..6e37c44 100644
> --- a/src/xkb.xml
> +++ b/src/xkb.xml
> @@ -547,26 +547,10 @@ authorization from the authors.
>  
>  	<typedef oldname="char" newname="STRING8" />
>  
> -	<!-- XXX: Property is broken
> -	<struct name="Property">
> -		<field name="nameLength" type="CARD16" />
> -		<list name="name" type="STRING8">
> -			<fieldref>nameLength</fieldref>
> -		</list>
> -		<field name="valueLength" type="CARD16" />
> -		<list name="value" type="STRING8">
> -			<fieldref>valueLength</fieldref>
> -		</list>
> -	</struct>
> -	-->
> -	<!-- XXX: This would be the correct Property structure as per spec.,
> -		  but it's broken atm. too. Add it anyway here, so we don't
> -		  loose that information.

These parts were commented out only recently, please see the git history
and the mailing list discussions accompanying these patches (you can use
'git blame src/xkb.xml' to see the commits which did the commenting-out).
Why do you believe they work now?

>  	<struct name="Property">
>  		<field name="name" type="CountedString16" />
>  		<field name="value" type="CountedString16" />
>  	</struct>
> -	-->
>  
>  	<struct name="Outline">
>  		<field name="nPoints" type="CARD8" />
> @@ -643,7 +627,6 @@ authorization from the authors.
>  		<item name="Logo">      <value>5</value> </item>
>  	</enum>
>  
> -	<!-- XXX: doodads are broken

Doodads are particularly troublesome as far as XCB and the code
generator go. They do not work properly, please see this thread:
http://lists.freedesktop.org/archives/xcb/2013-August/008448.html

>  	<struct name="CommonDoodad">
>  		<field name="name" type="ATOM" />
>  		<field name="type" type="CARD8" enum="DoodadType" />
> @@ -737,7 +720,6 @@ authorization from the authors.
>  			<fieldref>nOverlays</fieldref>
>  		</list>
>  	</struct>
> -	-->
>  
>  	<struct name="Listing">
>  		<field name="flags" type="CARD16" />
> @@ -1829,7 +1811,6 @@ authorization from the authors.
>  		</switch>
>  	</request>
>  
> -	<!-- XXX: Property and doodads are broken, which renders GetGeometry useless
>  	<request name="GetGeometry" opcode="19">
>  		<field name="deviceSpec" type="DeviceSpec" />
>  		<pad bytes="2" />
> @@ -1870,9 +1851,7 @@ authorization from the authors.
>  			</list>
>  		</reply>
>  	</request>
> -	-->
>  
> -	<!-- XXX: Property and doodads are broken, which renders SetGeometry useless
>  	<request name="SetGeometry" opcode="20">
>  		<field name="deviceSpec" type="DeviceSpec" />
>  		<field name="nShapes" type="CARD8" />
> @@ -1907,7 +1886,6 @@ authorization from the authors.
>  			<fieldref>nKeyAliases</fieldref>
>  		</list>
>  	</request>
> -	-->
>  
>  	<request name="PerClientFlags" opcode="21">
>  		<field name="deviceSpec" type="DeviceSpec" />
> @@ -1930,11 +1908,8 @@ authorization from the authors.
>  	<request name="ListComponents" opcode="22">
>  		<field name="deviceSpec" type="DeviceSpec" />
>  		<field name="maxNames" type="CARD16" />
> -		<!-- XXX: Intermixed fixed size fields and lists are broken
> -		<field name="keymapsSpecLen" type="CARD8" />
> -		<list name="keymapsSpec" type="STRING8">
> -			<fieldref>keymapsSpecLen</fieldref>
> -		</list>
> +		<!-- CL: there is no list named keymapsSpec in the request 
> +			( only the reply contains a list of keymaps) -->

Why do you say that?
The xkbproto spec says:

1     CARD8          opcode
1     22          xkb-opcode
2     2+(6+m+k+t+c+s+g+p)/4          request-length
2     KB_DEVICESPEC           deviceSpec
2     CARD16          maxNames
1     m          keymapsSpecLen
m     STRING          keymapsSpec
1     k          keycodesSpecLen
k     STRING          keycodesSpec
1     t          typesSpecLen
t     STRING          typesSpec
1     c          compatMapSpecLen
c     STRING          compatMapSpec
1     s          symbolsSpecLen
s     STRING          symbolsSpec
1     g          geometrySpecLen
g     STRING          geometrySpec
p               unused,p=pad(6+m+k+t+c+s+g)

And this is what libX11 sends as well. Recently support for that request
was removed from the server entirely, i.e. it just gives 0's for all the
items back (the request was apparently broken for a long time and nobody
noticed).

>  		<field name="keycodesSpecLen" type="CARD8" />
>  		<list name="keycodesSpec" type="STRING8">
>  			<fieldref>keycodesSpecLen</fieldref>
> @@ -1955,7 +1930,6 @@ authorization from the authors.
>  		<list name="geometrySpec" type="STRING8">
>  			<fieldref>geometrySpecLen</fieldref>
>  		</list>
> -		-->
>  		<reply>
>  			<field name="deviceID" type="CARD8" />
>  			<field name="nKeymaps" type="CARD16" />
> @@ -1993,11 +1967,7 @@ authorization from the authors.
>  		<field name="want" type="CARD16" mask="GBNDetail" />
>  		<field name="load" type="BOOL" />
>  		<pad bytes="1" />
> -		<!-- XXX: Intermixed fixed size fields and lists are broken
> -		<field name="keymapsSpecLen" type="CARD8" />
> -		<list name="keymapsSpec" type="STRING8">
> -			<fieldref>keymapsSpecLen</fieldref>
> -		</list>
> +		<!-- CL: there is no list named keymapsSpec in the request ( only the reply contains a list of keymaps) -->

The spec is similar here, that field is a part of the request, it is
just not supported by the server.

Ran

>  		<field name="keycodesSpecLen" type="CARD8" />
>  		<list name="keycodesSpec" type="STRING8">
>  			<fieldref>keycodesSpecLen</fieldref>
> @@ -2018,7 +1988,6 @@ authorization from the authors.
>  		<list name="geometrySpec" type="STRING8">
>  			<fieldref>geometrySpecLen</fieldref>
>  		</list>
> -		-->
>  		<reply>
>  			<field name="deviceID" type="CARD8" />
>  			<field name="minKeyCode" type="KEYCODE" />
> @@ -2292,7 +2261,6 @@ authorization from the authors.
>  					<field name="baseColorNdx" type="CARD8" />
>  					<field name="labelColorNdx" type="CARD8" />
>  					<field name="labelFont" type="CountedString16" />
> -					<!-- XXX: Property is broken
>  					<list name="properties" type="Property">
>  						<fieldref>nProperties</fieldref>
>  					</list>
> @@ -2302,8 +2270,6 @@ authorization from the authors.
>  					<list name="shapes" type="Shape">
>  						<fieldref>nShapes</fieldref>
>  					</list>
> -					-->
> -					<!-- XXX: doodads are broken
>  					<list name="sections" type="Section">
>  						<fieldref>nSections</fieldref>
>  					</list>
> @@ -2313,7 +2279,6 @@ authorization from the authors.
>  					<list name="keyAliases" type="KeyAlias">
>  						<fieldref>nKeyAliases</fieldref>
>  					</list>
> -					-->
>  				</bitcase>
>  			</switch>
>  		</reply>
> -- 
> 1.7.10.4
> 



More information about the Xcb mailing list