From 2b950e85f2b64a295c53f58b77b1738aa50f9bfc Mon Sep 17 00:00:00 2001 From: jstebbins Date: Thu, 21 Apr 2011 16:01:54 +0000 Subject: LinGui: Simplify some code in the hud compositor git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3948 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- gtk/src/ghbcompositor.c | 32 ++++++++++++-------------------- 1 file 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) { -- cgit v1.2.3