shortcuts: Ignore consumed modifiers for mnemonics

This is necessary to make mnemonics like Alt-1 work in
layouts where numeric keys are shifted, like AZERTY.

Fixes: #3912
This commit is contained in:
Matthias Clasen 2021-05-02 18:33:44 -04:00
parent 7578a18cd6
commit 6a5f93ff95

View File

@ -432,9 +432,11 @@ gtk_shortcut_controller_handle_event (GtkEventController *controller,
if (event_type == GDK_KEY_PRESS)
{
GdkModifierType modifiers;
GdkModifierType modifiers, consumed_modifiers;
modifiers = gdk_event_get_modifier_state (event);
enable_mnemonics = (modifiers & gtk_accelerator_get_default_mod_mask ()) == self->mnemonics_modifiers;
consumed_modifiers = gdk_key_event_get_consumed_modifiers (event);
enable_mnemonics = (modifiers & ~consumed_modifiers & gtk_accelerator_get_default_mod_mask ()) == self->mnemonics_modifiers;
}
else
{