From 10b65bb8d65694b0fc3faad1349551b3da32f1df Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Fri, 12 Nov 2004 21:40:27 +0000 Subject: Size-allocate the embed if it's not mapped but has never been 2004-11-12 Christian Persch * src/ephy-tab.c: (ephy_tab_size_allocate), (ephy_tab_map): Size-allocate the embed if it's not mapped but has never been size-allocated before. Fixes bug #156854. --- src/ephy-tab.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ephy-tab.c b/src/ephy-tab.c index 86897e764..19add5841 100644 --- a/src/ephy-tab.c +++ b/src/ephy-tab.c @@ -262,14 +262,18 @@ ephy_tab_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GtkWidget *child; + GtkAllocation invalid = { -1, -1, 1, 1 }; widget->allocation = *allocation; child = GTK_BIN (widget)->child; g_return_if_fail (child != NULL); - /* only resize if we're mapped (which means we're drawable) */ - if (GTK_WIDGET_MAPPED (child)) + /* only resize if we're mapped (bug #128191), + * or if this is the initial size-allocate (bug #156854). + */ + if (GTK_WIDGET_MAPPED (child) || + memcmp (&child->allocation, &invalid, sizeof (GtkAllocation)) == 0) { gtk_widget_size_allocate (child, allocation); } @@ -287,8 +291,13 @@ ephy_tab_map (GtkWidget *widget) /* we do this since the window might have been resized while this * tab wasn't mapped (i.e. was a non-active tab during the resize). + * See bug #156854. */ - gtk_widget_size_allocate (child, &widget->allocation); + if (memcmp (&widget->allocation, &child->allocation, + sizeof (GtkAllocation)) != 0) + { + gtk_widget_size_allocate (child, &widget->allocation); + } GTK_WIDGET_CLASS (parent_class)->map (widget); } -- cgit v1.2.3