summaryrefslogtreecommitdiff
path: root/gtk/gtkkeyhash.c
diff options
context:
space:
mode:
authorMichael Natterer <mitch@lanedo.com>2011-11-18 15:14:31 +0100
committerMichael Natterer <mitch@gimp.org>2011-11-18 15:14:31 +0100
commit9c79f9f868617a918e301c14ebeeff1bdc4c7e9d (patch)
tree5f0ad8393b830c1ff6d8b150937b1e6e6011b487 /gtk/gtkkeyhash.c
parent1c8481a6ea52f34210177f54159d231ea4ba0b7d (diff)
downloadgtk+-9c79f9f868617a918e301c14ebeeff1bdc4c7e9d.tar.gz
Turn the private #define for the group-shifting modifier into API
Add GDK_MODIFIER_INTENT_SHIFT_GROUP to enum GdkModifierIntent and handle it in gdk_keymap_get_modifier_mask(). Add an X11 impl of the method and return keymap_x11->group_switch_mask. Return 0 from the default impl because we don't know.
Diffstat (limited to 'gtk/gtkkeyhash.c')
-rw-r--r--gtk/gtkkeyhash.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk/gtkkeyhash.c b/gtk/gtkkeyhash.c
index 954b9a1003..fd26739091 100644
--- a/gtk/gtkkeyhash.c
+++ b/gtk/gtkkeyhash.c
@@ -395,6 +395,7 @@ _gtk_key_hash_lookup (GtkKeyHash *key_hash,
gint level;
GdkModifierType modifiers;
GdkModifierType consumed_modifiers;
+ GdkModifierType shift_group_mask;
gboolean group_mod_is_accel_mod = FALSE;
const GdkModifierType xmods = GDK_MOD2_MASK|GDK_MOD3_MASK|GDK_MOD4_MASK|GDK_MOD5_MASK;
const GdkModifierType vmods = GDK_SUPER_MASK|GDK_HYPER_MASK|GDK_META_MASK;
@@ -411,7 +412,9 @@ _gtk_key_hash_lookup (GtkKeyHash *key_hash,
/* if the group-toggling modifier is part of the default accel mod
* mask, and it is active, disable it for matching
*/
- if (mask & GTK_TOGGLE_GROUP_MOD_MASK)
+ shift_group_mask = gdk_keymap_get_modifier_mask (key_hash->keymap,
+ GDK_MODIFIER_INTENT_SHIFT_GROUP);
+ if (mask & shift_group_mask)
group_mod_is_accel_mod = TRUE;
gdk_keymap_map_virtual_modifiers (key_hash->keymap, &mask);
@@ -449,8 +452,7 @@ _gtk_key_hash_lookup (GtkKeyHash *key_hash,
* otherwise we can get multiple exact matches, some being
* bogus */
(!group_mod_is_accel_mod ||
- (state & GTK_TOGGLE_GROUP_MOD_MASK) ==
- (entry->modifiers & GTK_TOGGLE_GROUP_MOD_MASK)))
+ (state & shift_group_mask) == (entry->modifiers & shift_group_mask)))
{
GTK_NOTE (KEYBINDINGS,