listbox: Properly remove placeholders
authorTimm Bäder <mail@baedert.org>
Fri, 7 Apr 2017 17:02:35 +0000 (19:02 +0200)
committerTimm Bäder <mail@baedert.org>
Tue, 25 Apr 2017 19:51:59 +0000 (21:51 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=778617

gtk/gtklistbox.c

index f16e02aff86ae72f2a18a98f49547546b05bdb56..2bc6bfde43d379c2103ff0702338ae56dfa1e83a 100644 (file)
@@ -2451,6 +2451,16 @@ gtk_list_box_remove (GtkContainer *container,
 
   was_visible = gtk_widget_get_visible (child);
 
+  if (child == priv->placeholder)
+    {
+      gtk_widget_unparent (child);
+      priv->placeholder = NULL;
+      if (was_visible && gtk_widget_get_visible (widget))
+        gtk_widget_queue_resize (widget);
+
+      return;
+    }
+
   if (!GTK_IS_LIST_BOX_ROW (child))
     {
       row = g_hash_table_lookup (priv->header_hash, child);
@@ -2532,7 +2542,7 @@ gtk_list_box_forall (GtkContainer *container,
   GSequenceIter *iter;
   GtkListBoxRow *row;
 
-  if (priv->placeholder != NULL && include_internals)
+  if (priv->placeholder != NULL)
     callback (priv->placeholder, callback_target);
 
   iter = g_sequence_get_begin_iter (priv->children);