summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-07-10 11:10:30 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-07-10 11:23:52 +1000
commit3711d68f657c77b947cc4670cc4eac4f62de3af8 (patch)
treee58d62b1ff84d9a69ef1ad22c6f4d070af9d2554 /include
parent08df24555cb432eb0d90a3f63275e9485e777c4c (diff)
Revert "XKB: Sanitise * actions" commits (#19602)
Reverts the following four patches: feb757f384382c7782ceac55 "XKB: Sanitise vmods for redirected keys" b5f49382fe48f0a762d9a15f "XKB: Sanitise ctrls action" 1bd7fd195d85681e722161f8 "XKB: Sanitise pointer actions" 61c508fa78aa08ea2666fde9 "XKB: Sanitise vmods in actions" Strictly speaking, the structs used in the server are not part of the client ABI. Practically, they are as we copy from the wire straight into the structs. Changing the struct sizes breaks various wire/server conversions. Even when the structs have the same size, some internal magic causes conversions to fail. Visible by diffing the output files of: setxkbmap -layout de; xkbcomp -xkb :0 busted.xkb setxkbmap -layout de -print | xkbcomp -xkb - correct.xkb Interestingly enough, busted.xkb is the working one although the output is incorrect. Revert the four offending patches until the exact cause of this breakage can be determined. This patch restores functionality to Level3 modifiers. X.Org Bug 19602 <http://bugs.freedesktop.org/show_bug.cgi?id=19602> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'include')
-rw-r--r--include/xkbstr.h53
1 files changed, 46 insertions, 7 deletions
diff --git a/include/xkbstr.h b/include/xkbstr.h
index ec19b30c2..4afe010d2 100644
--- a/include/xkbstr.h
+++ b/include/xkbstr.h
@@ -123,8 +123,14 @@ typedef struct _XkbModAction {
unsigned char flags;
unsigned char mask;
unsigned char real_mods;
- unsigned int vmods;
+ /* FIXME: Make this an int. */
+ unsigned char vmods1;
+ unsigned char vmods2;
} XkbModAction;
+#define XkbModActionVMods(a) ((short) (((a)->vmods1 << 8) | (a)->vmods2))
+#define XkbSetModActionVMods(a,v) \
+ ((a)->vmods1 = (((v) >> 8) & 0xff), \
+ (a)->vmods2 = (v) & 0xff)
typedef struct _XkbGroupAction {
unsigned char type;
@@ -143,15 +149,23 @@ typedef struct _XkbISOAction {
/* FIXME: Make this an int. */
char group_XXX;
unsigned char affect;
- unsigned int vmods;
+ unsigned char vmods1;
+ unsigned char vmods2;
} XkbISOAction;
typedef struct _XkbPtrAction {
unsigned char type;
unsigned char flags;
- int x;
- int y;
+ /* FIXME: Make this an int. */
+ unsigned char high_XXX;
+ unsigned char low_XXX;
+ unsigned char high_YYY;
+ unsigned char low_YYY;
} XkbPtrAction;
+#define XkbPtrActionX(a) (Xkb2CharsToInt((a)->high_XXX,(a)->low_XXX))
+#define XkbPtrActionY(a) (Xkb2CharsToInt((a)->high_YYY,(a)->low_YYY))
+#define XkbSetPtrActionX(a,x) (XkbIntTo2Chars(x,(a)->high_XXX,(a)->low_XXX))
+#define XkbSetPtrActionY(a,y) (XkbIntTo2Chars(y,(a)->high_YYY,(a)->low_YYY))
typedef struct _XkbPtrBtnAction {
unsigned char type;
@@ -180,8 +194,20 @@ typedef struct _XkbSwitchScreenAction {
typedef struct _XkbCtrlsAction {
unsigned char type;
unsigned char flags;
- unsigned long ctrls;
+ /* FIXME: Make this an int. */
+ unsigned char ctrls3;
+ unsigned char ctrls2;
+ unsigned char ctrls1;
+ unsigned char ctrls0;
} XkbCtrlsAction;
+#define XkbActionSetCtrls(a, c) ((a)->ctrls3 = ((c) >> 24) & 0xff, \
+ (a)->ctrls2 = ((c) >> 16) & 0xff, \
+ (a)->ctrls1 = ((c) >> 8) & 0xff, \
+ (a)->ctrls0 = (c) & 0xff)
+#define XkbActionCtrls(a) ((((unsigned int)(a)->ctrls3)<<24)|\
+ (((unsigned int)(a)->ctrls2)<<16)|\
+ (((unsigned int)(a)->ctrls1)<<8)|\
+ ((unsigned int) (a)->ctrls0))
typedef struct _XkbMessageAction {
unsigned char type;
@@ -194,10 +220,23 @@ typedef struct _XkbRedirectKeyAction {
unsigned char new_key;
unsigned char mods_mask;
unsigned char mods;
- unsigned int vmods_mask;
- unsigned int vmods;
+ /* FIXME: Make this an int. */
+ unsigned char vmods_mask0;
+ unsigned char vmods_mask1;
+ unsigned char vmods0;
+ unsigned char vmods1;
} XkbRedirectKeyAction;
+#define XkbSARedirectVMods(a) ((((unsigned int)(a)->vmods1)<<8)|\
+ ((unsigned int)(a)->vmods0))
+/* FIXME: This is blatantly not setting vmods. Yeesh. */
+#define XkbSARedirectSetVMods(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\
+ ((a)->vmods_mask0=((m)&0xff)))
+#define XkbSARedirectVModsMask(a) ((((unsigned int)(a)->vmods_mask1)<<8)|\
+ ((unsigned int)(a)->vmods_mask0))
+#define XkbSARedirectSetVModsMask(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\
+ ((a)->vmods_mask0=((m)&0xff)))
+
typedef struct _XkbDeviceBtnAction {
unsigned char type;
unsigned char flags;