From ac5e84940d60d2864a741d27670d5237ba35e613 Mon Sep 17 00:00:00 2001 From: Pierre Le Marre Date: Fri, 24 Oct 2025 06:09:45 +0200 Subject: [PATCH] xkb: Fix endianness of the vmods encoding in XkbRedirectKeyAction Fixed erroneous little-endian encoding. Signed-off-by: Pierre Le Marre --- include/xkbstr.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/xkbstr.h b/include/xkbstr.h index 749f1f26e..f8147f3fc 100644 --- a/include/xkbstr.h +++ b/include/xkbstr.h @@ -235,15 +235,15 @@ typedef struct _XkbRedirectKeyAction { unsigned char vmods1; } XkbRedirectKeyAction; -#define XkbSARedirectVMods(a) ((((unsigned int)(a)->vmods1)<<8)|\ - ((unsigned int)(a)->vmods0)) +#define XkbSARedirectVMods(a) ((((unsigned int)(a)->vmods0)<<8)|\ + ((unsigned int)(a)->vmods1)) /* 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))) +#define XkbSARedirectSetVMods(a,m) (((a)->vmods_mask0=(((m)>>8)&0xff)),\ + ((a)->vmods_mask1=((m)&0xff))) +#define XkbSARedirectVModsMask(a) ((((unsigned int)(a)->vmods_mask0)<<8)|\ + ((unsigned int)(a)->vmods_mask1)) +#define XkbSARedirectSetVModsMask(a,m) (((a)->vmods_mask0=(((m)>>8)&0xff)),\ + ((a)->vmods_mask1=((m)&0xff))) typedef struct _XkbDeviceBtnAction { unsigned char type;