From 37d0f55392d68d0a05dcf5d793d729e49108f1b7 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 4 Aug 2013 13:31:29 +0300 Subject: [PATCH] xkb: Work around alignment problems in GetNames and GetMap replies The basic situation is this: a list of CARD8/CARD16s followed by a list of CARD16/CARD32s. In the current code, the second list is aligned to 1/2 bytes according the size of the first list. However, in some cases the second list needs to be aligned to 4 bytes per the xkbproto spec: http://www.x.org/releases/current/doc/kbproto/xkbproto.html#appD::Requests XkbGetMap reply (xkb-opcode 8): [...] a LISTofCARD8 actsRtrn.count p unused,p=pad(a) 8A LISTofKB_ACTION actsRtrn.acts 4B LISTofKB_SETBEHAVIOR behaviorsRtrn v LISTofSETofKEYMASK vmodsRtrn p unused, p=pad(v) 2E LISTofKB_SETEXPLICIT explicitRtrn p unused,p=pad(2E) 2M LISTofKB_KEYMODMAP modmapRtrn p unused, p=pad(2M) [...] XkbGetNames reply (xkb-opcode 17): [...] l LISTofCARD8 nLevelsPerType, sum of all elements=L p unused, p=pad(l) [...] The server and Xlib handle this with calls to XkbPaddedSize(), which is a good way to see where the extra padding is needed. Signed-off-by: Ran Benita Reviewed-by: Daniel Martin --- src/xkb.xml | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/src/xkb.xml b/src/xkb.xml index 0e263c4..15b3368 100644 --- a/src/xkb.xml +++ b/src/xkb.xml @@ -1350,6 +1350,20 @@ authorization from the authors. nKeyActions + + + + + nKeyActions + 3 + + + 3 + + + nKeyActions + + totalActions @@ -1365,18 +1379,60 @@ authorization from the authors. virtualMods + + + + + virtualMods + 3 + + + 3 + + + virtualMods + + ExplicitComponents totalKeyExplicit + + + + + totalKeyExplicit + 1 + + + 1 + + + totalKeyExplicit + + ModifierMap totalModMapKeys + + + + + totalModMapKeys + 1 + + + 1 + + + totalModMapKeys + + VirtualModMap @@ -1657,6 +1713,20 @@ authorization from the authors. nKTLevels --> nTypes + + + + + nTypes + 3 + + + 3 + + + nTypes + + -- 2.34.1