summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Pablo Ugarte <juanpablougarte@gmail.com>2018-03-06 19:51:12 -0300
committerJuan Pablo Ugarte <juanpablougarte@gmail.com>2018-03-06 19:58:05 -0300
commit3a4ad916c0ec181698fd5aae929b7f34d1d31a52 (patch)
treef369b958538292026bc0eebdc1b3fce50b7f1dd7
parent55752c8239f4b573ee31f418881dc7d3cddf0d2c (diff)
downloadglade-3a4ad916c0ec181698fd5aae929b7f34d1d31a52.tar.gz
Fix glade_util_container_get_all_children()
gtk_container_forall() no longer returns all children for all classes For example in GtkActionBar forall() only returns the internal revealer child and foreach() returns all the widgets added by the user which are inside a box which parent its the internal revealer So in order to get all the children we need to call forall() and foreach() and remove duplicates This fixes bug #778537 "ActionBar need placeholder"
-rw-r--r--gladeui/glade-utils.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gladeui/glade-utils.c b/gladeui/glade-utils.c
index 3365f7ae..ce3342c5 100644
--- a/gladeui/glade-utils.c
+++ b/gladeui/glade-utils.c
@@ -633,7 +633,8 @@ gtk_container_children_callback (GtkWidget *widget, gpointer client_data)
GList **children;
children = (GList **) client_data;
- *children = g_list_prepend (*children, widget);
+ if (!g_list_find (*children, widget))
+ *children = g_list_prepend (*children, widget);
}
/**
@@ -657,6 +658,7 @@ glade_util_container_get_all_children (GtkContainer *container)
g_return_val_if_fail (GTK_IS_CONTAINER (container), NULL);
gtk_container_forall (container, gtk_container_children_callback, &children);
+ gtk_container_foreach (container, gtk_container_children_callback, &children);
/* Preserve the natural order by reversing the list */
return g_list_reverse (children);