Commit c55ff6e4 authored by John Ralls's avatar John Ralls Committed by Matthias Clasen
Browse files

Bug 736125 - The default gtk accelerator mod mask does not include all default backend modifiers

parent 30d56933
......@@ -653,6 +653,10 @@ gdk_keymap_real_get_modifier_mask (GdkKeymap *keymap,
case GDK_MODIFIER_INTENT_SHIFT_GROUP:
return 0;
case GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK:
return (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK |
GDK_SUPER_MASK | GDK_HYPER_MASK | GDK_META_MASK);
default:
g_return_val_if_reached (0);
}
......
......@@ -291,6 +291,11 @@ typedef enum
* input methods, and for use cases like typeahead search.
* @GDK_MODIFIER_INTENT_SHIFT_GROUP: the modifier that switches between keyboard
* groups (AltGr on X11/Windows and Option/Alt on OS X).
* @GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK: The set of modifier masks accepted
* as modifiers in accelerators. Needed because Command is mapped to MOD2 on
* OSX, which is widely used, but on X11 MOD2 is NumLock and using that for a
* mod key is problematic at best.
* Ref: https://bugzilla.gnome.org/show_bug.cgi?id=736125.
*
* This enum is used with gdk_keymap_get_modifier_mask()
* in order to determine what modifiers the
......@@ -309,7 +314,8 @@ typedef enum
GDK_MODIFIER_INTENT_EXTEND_SELECTION,
GDK_MODIFIER_INTENT_MODIFY_SELECTION,
GDK_MODIFIER_INTENT_NO_TEXT_INPUT,
GDK_MODIFIER_INTENT_SHIFT_GROUP
GDK_MODIFIER_INTENT_SHIFT_GROUP,
GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK,
} GdkModifierIntent;
typedef enum
......
......@@ -761,6 +761,11 @@ gdk_quartz_keymap_get_modifier_mask (GdkKeymap *keymap,
case GDK_MODIFIER_INTENT_SHIFT_GROUP:
return GDK_MOD1_MASK;
case GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK:
return (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK |
GDK_MOD2_MASK | GDK_SUPER_MASK | GDK_HYPER_MASK |
GDK_META_MASK);
default:
g_return_val_if_reached (0);
}
......
......@@ -73,12 +73,7 @@ static void accel_closure_invalidate (gpointer data,
static guint signal_accel_activate = 0;
static guint signal_accel_changed = 0;
static guint quark_acceleratable_groups = 0;
static guint default_accel_mod_mask = (GDK_SHIFT_MASK |
GDK_CONTROL_MASK |
GDK_MOD1_MASK |
GDK_SUPER_MASK |
GDK_HYPER_MASK |
GDK_META_MASK);
static guint default_accel_mod_mask = 0;
enum {
PROP_0,
......@@ -1752,5 +1747,10 @@ gtk_accelerator_set_default_mod_mask (GdkModifierType default_mod_mask)
GdkModifierType
gtk_accelerator_get_default_mod_mask (void)
{
if (!default_accel_mod_mask)
default_accel_mod_mask =
gdk_keymap_get_modifier_mask (gdk_keymap_get_default (),
GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK);
return default_accel_mod_mask;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment