diff options
author | jstebbins <[email protected]> | 2009-04-16 22:47:39 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-04-16 22:47:39 +0000 |
commit | 2cc59aecfa52b7d8a90af739ce953c0e06aea7d0 (patch) | |
tree | cf7ca636ff4f966780ef67a33bef5aa53c499662 /gtk | |
parent | 77cd601ed19a9d289daf8225d87a61f302a9c5f7 (diff) |
LinGui: fix problem with allocating size of an unrealized widget
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2334 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/src/ghbcompositor.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/gtk/src/ghbcompositor.c b/gtk/src/ghbcompositor.c index df437ee0b..81628b6bf 100644 --- a/gtk/src/ghbcompositor.c +++ b/gtk/src/ghbcompositor.c @@ -364,17 +364,17 @@ ghb_compositor_zlist_insert ( gtk_widget_set_parent(child, GTK_WIDGET(compositor)); display = gtk_widget_get_display (GTK_WIDGET(compositor)); - if (gdk_display_supports_composite(display)) - { - cc = g_new(GhbCompositorChild, 1); - cc->widget = child; - cc->z_pos = z_pos; - cc->opacity = opacity; - cc->drawables = NULL; - compositor->children = g_list_insert_sorted( + cc = g_new(GhbCompositorChild, 1); + cc->widget = child; + cc->z_pos = z_pos; + cc->opacity = opacity; + cc->drawables = NULL; + compositor->children = g_list_insert_sorted( compositor->children, cc, zsort); + if (gdk_display_supports_composite(display)) + { GList *link; cc->drawables = find_drawables(NULL, cc->widget); @@ -570,6 +570,7 @@ ghb_compositor_size_allocate (GtkWidget *widget, GtkAllocation *allocation) child_allocation.x = 0; child_allocation.y = 0; } + child_allocation.width = MAX (allocation->width - GTK_CONTAINER (widget)->border_width * 2, 0); child_allocation.height = MAX (allocation->height - @@ -589,7 +590,8 @@ ghb_compositor_size_allocate (GtkWidget *widget, GtkAllocation *allocation) for (link = compositor->children; link != NULL; link = link->next) { cc = (GhbCompositorChild*)link->data; - gtk_widget_size_allocate (cc->widget, &child_allocation); + if (GTK_WIDGET_REALIZED (cc->widget)) + gtk_widget_size_allocate (cc->widget, &child_allocation); } } |