From bb54d7c84793003d90685a7210fb9614adedb77f Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Mon, 5 Nov 2007 19:55:05 +0000 Subject: Put size_allocate hack in MozillaEmbed now. svn path=/trunk/; revision=7629 --- embed/mozilla/mozilla-embed.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'embed/mozilla') diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp index 62cbd6adf..455d81b56 100644 --- a/embed/mozilla/mozilla-embed.cpp +++ b/embed/mozilla/mozilla-embed.cpp @@ -200,6 +200,28 @@ mozilla_embed_constructor (GType type, guint n_construct_properties, construct_params); } +static void +mozilla_embed_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 (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); + } +} + static void mozilla_embed_class_init (MozillaEmbedClass *klass) { @@ -214,6 +236,7 @@ mozilla_embed_class_init (MozillaEmbedClass *klass) widget_class->grab_focus = mozilla_embed_grab_focus; widget_class->realize = mozilla_embed_realize; + widget_class->size_allocate = mozilla_embed_size_allocate; g_type_class_add_private (object_class, sizeof(MozillaEmbedPrivate)); } -- cgit v1.2.3