[gtk/cut-shortcut-activation-short] shortcutcontroller: Only do round-robin for mnemonics
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/cut-shortcut-activation-short] shortcutcontroller: Only do round-robin for mnemonics
- Date: Tue, 3 Aug 2021 20:26:07 +0000 (UTC)
commit e961fa9f461bb3e8b50900de8d5e40129df17e46
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Aug 3 16:23:16 2021 -0400
shortcutcontroller: Only do round-robin for mnemonics
Don't do round-robin activation unless we are looking
for mnemonics, where this is an expected feature.
Fixes: #4130
gtk/gtkshortcutcontroller.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkshortcutcontroller.c b/gtk/gtkshortcutcontroller.c
index e830503b15..82f20ee56f 100644
--- a/gtk/gtkshortcutcontroller.c
+++ b/gtk/gtkshortcutcontroller.c
@@ -310,7 +310,11 @@ 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);
+ 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))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]