listview: Avoid a critical when reordering

When sorting a cell into the place its already at,
we were triggering criticals. Avoid that.

Fixes: #3180
This commit is contained in:
Matthias Clasen 2020-09-23 22:53:21 -04:00
parent 810218b2f5
commit 9fde0137a0

View File

@ -629,10 +629,13 @@ gtk_list_item_widget_reorder_child (GtkListItemWidget *self,
}
}
gtk_widget_insert_after (child, widget, sibling);
gtk_css_node_insert_after (gtk_widget_get_css_node (widget),
gtk_widget_get_css_node (child),
sibling ? gtk_widget_get_css_node (sibling) : NULL);
if (child != sibling)
{
gtk_widget_insert_after (child, widget, sibling);
gtk_css_node_insert_after (gtk_widget_get_css_node (widget),
gtk_widget_get_css_node (child),
sibling ? gtk_widget_get_css_node (sibling) : NULL);
}
}
void