Parse keyval name directly for mnemonic triggers

We don't need to parse the full accelerator format for mnemonic
triggers.
This commit is contained in:
Emmanuele Bassi 2020-03-26 16:47:15 +00:00
parent 96ccb25f97
commit 170e8bd605

View File

@ -137,8 +137,9 @@ gtk_shortcut_trigger_parse_string (const char *string)
if (string[0] == '_') if (string[0] == '_')
{ {
if (gtk_accelerator_parse (string + 1, &keyval, &modifiers)) keyval = gdk_keyval_from_name (string + 1);
return gtk_mnemonic_trigger_new (keyval); if (keyval != GDK_KEY_VoidSymbol)
return gtk_mnemonic_trigger_new (gdk_keyval_to_lower (keyval));
} }
if (gtk_accelerator_parse (string, &keyval, &modifiers)) if (gtk_accelerator_parse (string, &keyval, &modifiers))