summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/ghbcompositor.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/gtk/src/ghbcompositor.c b/gtk/src/ghbcompositor.c
index 7a05e58cd..b4054055f 100644
--- a/gtk/src/ghbcompositor.c
+++ b/gtk/src/ghbcompositor.c
@@ -307,35 +307,26 @@ showtype(const gchar *msg, GtkWidget *widget)
}
#endif
-static GList*
-find_drawables(GList *drawables, GtkWidget *widget)
+static void
+find_drawables(GtkWidget *widget, gpointer data)
{
+ GList *drawables, **pdrawables;
+ pdrawables = (GList**)data;
+ drawables = *pdrawables;
+
if (gtk_widget_get_has_window(widget))
{
drawables = g_list_append(drawables, widget);
- return drawables;
+ *pdrawables = drawables;
+ return;
}
if (GTK_IS_CONTAINER(widget))
{
- GList *children, *link;
-
- children = gtk_container_get_children(GTK_CONTAINER(widget));
- // Look for a child with a window
- for (link = children; link != NULL; link = link->next)
- {
- if (gtk_widget_get_has_window(GTK_WIDGET(link->data)))
- {
- drawables = g_list_append(drawables, link->data);
- }
- else
- {
- drawables = find_drawables(drawables, GTK_WIDGET(link->data));
- }
- }
+ gtk_container_forall(GTK_CONTAINER(widget), find_drawables, data);
}
- return drawables;
}
+
/**
* ghb_compositor_zlist_insert:
* @compositor: a #GhbCompositor
@@ -378,7 +369,8 @@ ghb_compositor_zlist_insert (
{
GList *link;
- cc->drawables = find_drawables(NULL, cc->widget);
+ cc->drawables = NULL;
+ find_drawables(cc->widget, &cc->drawables);
for (link = cc->drawables; link != NULL; link = link->next)
{