From 1f4130b927a5015402f2239ee009af7e8f0e16bc Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 28 May 2020 08:32:03 -0400 Subject: [PATCH 1/2] widget-factory: Add a mnemonic conflict Make Alt-e the mnemionic for both the Edit menu and the Select button on page 2. This shows that mnemonic cycling doesn't currently work, we always open the menu. --- demos/widget-factory/widget-factory.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui index 7523595c4b..5414ce82be 100644 --- a/demos/widget-factory/widget-factory.ui +++ b/demos/widget-factory/widget-factory.ui @@ -2169,7 +2169,7 @@ microphone-sensitivity-medium-symbolic - _Select + S_elect 1 From 2d80b105cef17fd790dbe8a0ae2c00a2da028e32 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 28 May 2020 08:52:55 -0400 Subject: [PATCH 2/2] shortcut controller: Fix mnemonic cycling Iterate the shortcuts we found in order, not in reverse. Otherwise, we always end up activating the last_selected one, since it is last in the list. This broke in fb9b54d4b209afc when a list was turned into an array. --- gtk/gtkshortcutcontroller.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/gtkshortcutcontroller.c b/gtk/gtkshortcutcontroller.c index 92f244455b..81ca7f7b26 100644 --- a/gtk/gtkshortcutcontroller.c +++ b/gtk/gtkshortcutcontroller.c @@ -373,7 +373,8 @@ gtk_shortcut_controller_run_controllers (GtkEventController *controller, if (!shortcuts) return retval; - for (i = shortcuts->len - 1, p = shortcuts->len; i >= 0; i--) + p = shortcuts->len; + for (i = 0; i < shortcuts->len; i++) { const ShortcutData *data = &g_array_index (shortcuts, ShortcutData, i);