From 170e8bd605bf983a9826ca255829846f40a2c59c Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 26 Mar 2020 16:47:15 +0000 Subject: [PATCH] Parse keyval name directly for mnemonic triggers We don't need to parse the full accelerator format for mnemonic triggers. --- gtk/gtkshortcuttrigger.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gtk/gtkshortcuttrigger.c b/gtk/gtkshortcuttrigger.c index fc36e809e5..6840ef10d2 100644 --- a/gtk/gtkshortcuttrigger.c +++ b/gtk/gtkshortcuttrigger.c @@ -137,8 +137,9 @@ gtk_shortcut_trigger_parse_string (const char *string) if (string[0] == '_') { - if (gtk_accelerator_parse (string + 1, &keyval, &modifiers)) - return gtk_mnemonic_trigger_new (keyval); + keyval = gdk_keyval_from_name (string + 1); + if (keyval != GDK_KEY_VoidSymbol) + return gtk_mnemonic_trigger_new (gdk_keyval_to_lower (keyval)); } if (gtk_accelerator_parse (string, &keyval, &modifiers))