From 28042ef3363f8ad069190c355503801b20742217 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 11 Apr 2016 07:52:39 -0400 Subject: [PATCH] listbox: Fix css node ordering When inserting a child at the top, we were not inserting its css node properly. https://bugzilla.gnome.org/show_bug.cgi?id=764710 --- gtk/gtklistbox.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c index c3aa6a9e7f..2ffa76802f 100644 --- a/gtk/gtklistbox.c +++ b/gtk/gtklistbox.c @@ -2814,17 +2814,18 @@ gtk_list_box_insert_css_node (GtkListBox *box, GSequenceIter *iter) { GSequenceIter *prev_iter; - GtkWidget *sibling; + GtkCssNode *sibling; prev_iter = g_sequence_iter_prev (iter); if (prev_iter != iter) - { - sibling = g_sequence_get (prev_iter); - gtk_css_node_insert_after (gtk_widget_get_css_node (GTK_WIDGET (box)), - gtk_widget_get_css_node (child), - gtk_widget_get_css_node (sibling)); - } + sibling = gtk_widget_get_css_node (g_sequence_get (prev_iter)); + else + sibling = NULL; + + gtk_css_node_insert_after (gtk_widget_get_css_node (GTK_WIDGET (box)), + gtk_widget_get_css_node (child), + sibling); } /**