From 9c2a5c6c61edfedc873cfe7a159f8d01377a13a0 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 19 Sep 2012 15:23:35 +0300 Subject: [PATCH] xkbcomp/keymap: correct ACTION_MODS_LOOKUP_MODS handling The xkblib spec says: If XkbSA_UseModMapMods is not set in the flags field, the mask, real_mods, vmods1, and vmods2 fields are used to determine the action modifiers. Otherwise they are ignored and the modifiers bound to the key (client map->modmap[keycode]) are used instead. So we should just assign the modmap without considering what's there. Signed-off-by: Ran Benita --- src/xkbcomp/keymap.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/xkbcomp/keymap.c b/src/xkbcomp/keymap.c index 59fea7a..6e9c911 100644 --- a/src/xkbcomp/keymap.c +++ b/src/xkbcomp/keymap.c @@ -47,29 +47,19 @@ ComputeEffectiveMask(struct xkb_keymap *keymap, struct xkb_mods *mods) static void UpdateActionMods(struct xkb_keymap *keymap, union xkb_action *act, - xkb_mod_mask_t rmodmask) + xkb_mod_mask_t modmap) { - unsigned int flags; - struct xkb_mods *mods; - switch (act->type) { case ACTION_TYPE_MOD_SET: case ACTION_TYPE_MOD_LATCH: case ACTION_TYPE_MOD_LOCK: - flags = act->mods.flags; - mods = &act->mods.mods; + if (act->mods.flags & ACTION_MODS_LOOKUP_MODMAP) + act->mods.mods.mods = modmap; + ComputeEffectiveMask(keymap, &act->mods.mods); break; - default: - return; - } - - if (flags & ACTION_MODS_LOOKUP_MODMAP) { - /* XXX: what's that. */ - mods->mods &= 0xff; - mods->mods |= rmodmask; + break; } - ComputeEffectiveMask(keymap, mods); } /** -- 2.7.4