aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-10-05 22:56:09 +0800
committerChristian Persch <chpe@src.gnome.org>2004-10-05 22:56:09 +0800
commit93ea2e443535f7f4cc7caea44338805e3c77a2d7 (patch)
treed97d68849315d2dc9a986a263bee8eb7d6ba0a8e /src
parent4a908fdf31de0e6af305beac5eb95e3f471fefdd (diff)
downloadgsoc2013-epiphany-93ea2e443535f7f4cc7caea44338805e3c77a2d7.tar
gsoc2013-epiphany-93ea2e443535f7f4cc7caea44338805e3c77a2d7.tar.gz
gsoc2013-epiphany-93ea2e443535f7f4cc7caea44338805e3c77a2d7.tar.bz2
gsoc2013-epiphany-93ea2e443535f7f4cc7caea44338805e3c77a2d7.tar.lz
gsoc2013-epiphany-93ea2e443535f7f4cc7caea44338805e3c77a2d7.tar.xz
gsoc2013-epiphany-93ea2e443535f7f4cc7caea44338805e3c77a2d7.tar.zst
gsoc2013-epiphany-93ea2e443535f7f4cc7caea44338805e3c77a2d7.zip
Don't size-allocate unmapped tabs, fixing slow resizes. Fixes bug #128191.
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.
Diffstat (limited to 'src')
-rw-r--r--src/ephy-tab.c25
1 files changed, 23 insertions, 2 deletions
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",