[gtk/matthiasc/for-master] listview: Avoid a critical when reordering
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master] listview: Avoid a critical when reordering
- Date: Thu, 24 Sep 2020 02:54:42 +0000 (UTC)
commit 9fde0137a052ebdb0374a1303a70517cd43afa72
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Sep 23 22:53:21 2020 -0400
listview: Avoid a critical when reordering
When sorting a cell into the place its already at,
we were triggering criticals. Avoid that.
Fixes: #3180
gtk/gtklistitemwidget.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtklistitemwidget.c b/gtk/gtklistitemwidget.c
index 5c57d1b257..ce4f505039 100644
--- a/gtk/gtklistitemwidget.c
+++ b/gtk/gtklistitemwidget.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]