summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-04-21 16:01:54 +0000
committerjstebbins <[email protected]>2011-04-21 16:01:54 +0000
commit2b950e85f2b64a295c53f58b77b1738aa50f9bfc (patch)
tree7c611a14ec35bbd2cd707273c3dcbc18904f27d4
parent07a9c6ff95b945306db94cd218a5a79e633d64dd (diff)
LinGui: Simplify some code in the hud compositor
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3948 b64f7644-9d1e-0410-96f1-a4d463321fa5
-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)
{