summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-08-20 13:50:51 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-08-20 13:50:51 +0000
commit92817b06036ca827e47135a9e43afdf744c2ed80 (patch)
tree0f758be02fd0d5edd6e57f8dc890aa0a36db0e5d
parentbe34f27026eb93339ff1986c631341a93c698ea9 (diff)
parentf8a1726ffabdcbcee4212b6823e4dd844e4247f7 (diff)
downloadgtk+-92817b06036ca827e47135a9e43afdf744c2ed80.tar.gz
Merge branch 'cut-shortcut-activation-short' into 'master'
shortcutcontroller: Only do round-robin for mnemonics Closes #4130 See merge request GNOME/gtk!3824
-rw-r--r--gtk/gtkshortcutcontroller.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gtk/gtkshortcutcontroller.c b/gtk/gtkshortcutcontroller.c
index e830503b15..5eb0187022 100644
--- a/gtk/gtkshortcutcontroller.c
+++ b/gtk/gtkshortcutcontroller.c
@@ -310,7 +310,14 @@ gtk_shortcut_controller_run_controllers (GtkEventController *controller,
GtkWidget *widget;
GtkNative *native;
- index = (self->last_activated + 1 + i) % g_list_model_get_n_items (self->shortcuts);
+ /* This is not entirely right, but we only want to do round-robin cycling
+ * for mnemonics.
+ */
+ if (enable_mnemonics)
+ index = (self->last_activated + 1 + i) % g_list_model_get_n_items (self->shortcuts);
+ else
+ index = i;
+
shortcut = g_list_model_get_item (self->shortcuts, index);
if (!GTK_IS_SHORTCUT (shortcut))
{