Merge branch 'cut-shortcut-activation-short' into 'master'

shortcutcontroller: Only do round-robin for mnemonics

Closes #4130

See merge request GNOME/gtk!3824
This commit is contained in:
Matthias Clasen 2021-08-20 13:50:51 +00:00
commit 92817b0603

View File

@ -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))
{