From 8a0da1cb0775607e0738b93792225d499e6545f2 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 19 Aug 2014 14:57:48 -0400 Subject: [PATCH] keybindings: Make sure to filter out the virtualized mod itself When devirtualizing the modifier, we can't include the virtualized mod itself, otherwise our grab won't have the correct mask. --- src/core/keybindings.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/keybindings.c b/src/core/keybindings.c index ba6a39990..fe7eccd70 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -213,8 +213,9 @@ reload_modmap (MetaKeyBindingManager *keys) if (idx != XKB_MOD_INVALID) { - xkb_state_update_mask (scratch_state, 1 << idx, 0, 0, 0, 0, 0); - *mask_p = xkb_state_serialize_mods (scratch_state, XKB_STATE_MODS_DEPRESSED); + xkb_mod_mask_t vmodmask = (1 << idx); + xkb_state_update_mask (scratch_state, vmodmask, 0, 0, 0, 0, 0); + *mask_p = xkb_state_serialize_mods (scratch_state, XKB_STATE_MODS_DEPRESSED) & ~vmodmask; } else *mask_p = 0;