diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/ephy-tab.c | 25 |
2 files changed, 31 insertions, 2 deletions
@@ -1,5 +1,13 @@ 2004-10-05 Christian Persch <chpe@cvs.gnome.org> + * src/ephy-tab.c: (ephy_tab_size_allocate), (ephy_tab_map), + (ephy_tab_class_init): + + Don't size-allocate unmapped tabs, fixing slow resizes. + Fixes bug #128191. + +2004-10-05 Christian Persch <chpe@cvs.gnome.org> + * configure.ac: * lib/egg/Makefile.am: R lib/egg/eggdropdowntoolbutton.c: diff --git a/src/ephy-tab.c b/src/ephy-tab.c index 1d0e083ca..95042b298 100644 --- a/src/ephy-tab.c +++ b/src/ephy-tab.c @@ -266,13 +266,33 @@ ephy_tab_size_allocate (GtkWidget *widget, widget->allocation = *allocation; child = GTK_BIN (widget)->child; + g_return_if_fail (child != NULL); - if (child && GTK_WIDGET_VISIBLE (child)) + /* only resize if we're mapped (which means we're drawable) */ + if (GTK_WIDGET_MAPPED (child)) { gtk_widget_size_allocate (child, allocation); } } +static void +ephy_tab_map (GtkWidget *widget) +{ + GtkWidget *child; + + g_return_if_fail (GTK_WIDGET_REALIZED (widget)); + + child = GTK_BIN (widget)->child; + g_return_if_fail (child != NULL); + + /* 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). + */ + gtk_widget_size_allocate (child, &widget->allocation); + + GTK_WIDGET_CLASS (parent_class)->map (widget); +} + static EphyWindow * ephy_tab_get_window (EphyTab *tab) { @@ -314,7 +334,8 @@ ephy_tab_class_init (EphyTabClass *class) object_class->set_property = ephy_tab_set_property; widget_class->size_allocate = ephy_tab_size_allocate; - + widget_class->map = ephy_tab_map; + g_object_class_install_property (object_class, PROP_ADDRESS, g_param_spec_string ("address", |