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.
This commit is contained in:
Jasper St. Pierre 2014-08-19 14:57:48 -04:00
parent 1445903a34
commit 8a0da1cb07

View File

@ -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;