diff --git a/src/core/keybindings-private.h b/src/core/keybindings-private.h index 793966e5d..5a17c991f 100644 --- a/src/core/keybindings-private.h +++ b/src/core/keybindings-private.h @@ -94,8 +94,11 @@ typedef struct GHashTable *key_bindings_index; xkb_mod_mask_t ignored_modifier_mask; xkb_mod_mask_t hyper_mask; + xkb_mod_mask_t virtual_hyper_mask; xkb_mod_mask_t super_mask; + xkb_mod_mask_t virtual_super_mask; xkb_mod_mask_t meta_mask; + xkb_mod_mask_t virtual_meta_mask; MetaKeyCombo overlay_key_combo; MetaResolvedKeyCombo overlay_resolved_key_combo; gboolean overlay_key_only_pressed; diff --git a/src/core/keybindings.c b/src/core/keybindings.c index a5cb0d745..2a8063eb5 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -185,16 +185,18 @@ reload_modmap (MetaKeyBindingManager *keys) struct xkb_keymap *keymap = meta_backend_get_keymap (backend); struct xkb_state *scratch_state; xkb_mod_mask_t scroll_lock_mask; + xkb_mod_mask_t dummy_mask; /* Modifiers to find. */ struct { const char *name; xkb_mod_mask_t *mask_p; + xkb_mod_mask_t *virtual_mask_p; } mods[] = { - { "ScrollLock", &scroll_lock_mask }, - { "Meta", &keys->meta_mask }, - { "Hyper", &keys->hyper_mask }, - { "Super", &keys->super_mask }, + { "ScrollLock", &scroll_lock_mask, &dummy_mask }, + { "Meta", &keys->meta_mask, &keys->virtual_meta_mask }, + { "Hyper", &keys->hyper_mask, &keys->virtual_hyper_mask }, + { "Super", &keys->super_mask, &keys->virtual_super_mask }, }; scratch_state = xkb_state_new (keymap); @@ -203,6 +205,7 @@ reload_modmap (MetaKeyBindingManager *keys) for (i = 0; i < G_N_ELEMENTS (mods); i++) { xkb_mod_mask_t *mask_p = mods[i].mask_p; + xkb_mod_mask_t *virtual_mask_p = mods[i].virtual_mask_p; xkb_mod_index_t idx = xkb_keymap_mod_get_index (keymap, mods[i].name); if (idx != XKB_MOD_INVALID) @@ -210,9 +213,13 @@ reload_modmap (MetaKeyBindingManager *keys) 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; + *virtual_mask_p = vmodmask; } else - *mask_p = 0; + { + *mask_p = 0; + *virtual_mask_p = 0; + } } xkb_state_unref (scratch_state);