[Xcb] [patch] bugfix: xproto.xml request GetKeyboardMapping

Jamey Sharp jamey at minilop.net
Fri Nov 30 23:26:56 PST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/29/07, Thien-Thi Nguyen <ttn at gnuvola.org> wrote:
> thanks for writing xcb-proto; i like playing w/ it.
> see <http://www.gnuvola.org/data/> for current hackery.

Interesting! S-expressions seem like a fine choice for representing this
information, though I don't expect that we'll switch from XML in favor
of them. :-) A tool to automatically translate back and forth should be
pretty easy to write though...

> i think i found a bug, however.  below is the local fix.
> what do you think?

> -          <fieldref>length</fieldref>
> -          <value>4</value>

You know... I think that *is* buggy. The protocol specification says
that the length of the list, in bytes, is "4nm", where "nm" is stored in
the length field of the reply. But each list element is a KEYSYM, which
is just a CARD32, so the size of each list element is 4. The current
definition, then, declares that the list is 16*n*m bytes long.

> +          <fieldref>count</fieldref>
> +          <fieldref>keysyms_per_keycode</fieldref>

But we can't use your fix as-is, because the value of the 'count' field
in the request is not available when the reply is being processed.

I think the following patch should work instead, but would somebody else
review before I screw up our protocol descriptions? :-)

Jamey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHUQygp1aplQ4I9mURAvtyAJ4uWUw2bMgmsPP2GQ4pzHLnMjSlEwCffHeP
jMtinT7k4FoM1jfd/okFpH0=
=eNVs
-----END PGP SIGNATURE-----

diff --git a/src/xproto.xml b/src/xproto.xml
index 8254d11..0b796a9 100644
--- a/src/xproto.xml
+++ b/src/xproto.xml
@@ -2014,10 +2014,7 @@ authorization from the authors.
       <field type="BYTE" name="keysyms_per_keycode" />
       <pad bytes="24" />
       <list type="KEYSYM" name="keysyms">
-        <op op="*">
-          <fieldref>length</fieldref>
-          <value>4</value>
-        </op>
+        <fieldref>length</fieldref>
       </list>
     </reply>
   </request>


More information about the Xcb mailing list