From 115d0cdc07e073dd2c1b331aca2215d8ac8ed1ce Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 14 Jul 2020 14:47:23 -0400 Subject: [PATCH] Fix shortcuts section reflow When this code was ported from gtk_container_get_children to the dom api, we inadvertendly inverted the order of the list in one place. With the dom api, we can just avoid reversing lists altogether, so do that. Fixes: #2928 --- gtk/gtkshortcutssection.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gtk/gtkshortcutssection.c b/gtk/gtkshortcutssection.c index 7aef6791f5..5f5be70582 100644 --- a/gtk/gtkshortcutssection.c +++ b/gtk/gtkshortcutssection.c @@ -543,21 +543,20 @@ gtk_shortcuts_section_reflow_groups (GtkShortcutsSection *self) { GtkWidget *column; - for (column = gtk_widget_get_first_child (page); + for (column = gtk_widget_get_last_child (page); column != NULL; - column = gtk_widget_get_next_sibling (column)) + column = gtk_widget_get_prev_sibling (column)) { GtkWidget *group; - for (group = gtk_widget_get_first_child (column); + for (group = gtk_widget_get_last_child (column); group != NULL; - group = gtk_widget_get_next_sibling (group)) + group = gtk_widget_get_prev_sibling (group)) { groups = g_list_prepend (groups, group); } } } - groups = g_list_reverse (groups); /* create new pages */ current_page = NULL; @@ -642,7 +641,6 @@ gtk_shortcuts_section_reflow_groups (GtkShortcutsSection *self) child != NULL; child = gtk_widget_get_prev_sibling (child)) content = g_list_prepend (content, child); - content = g_list_reverse (content); n = 0; for (g = g_list_last (content); g; g = g->prev)