From 6087d7632df9c47377731b851022661bddcbf9e4 Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Wed, 16 Feb 2011 13:03:33 +0100 Subject: gedit-overlay: always proxy main widget size request We don't want for the children to be able to overflow the main widget, it makes sense to keep them contained in the overlay. Bug #642451 --- lib/widgets/gedit-overlay.c | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'lib/widgets') diff --git a/lib/widgets/gedit-overlay.c b/lib/widgets/gedit-overlay.c index 16ee8cf78..902f13daa 100644 --- a/lib/widgets/gedit-overlay.c +++ b/lib/widgets/gedit-overlay.c @@ -150,24 +150,13 @@ gedit_overlay_get_preferred_width (GtkWidget *widget, gint *natural) { GeditOverlayPrivate *priv = GEDIT_OVERLAY (widget)->priv; - GtkWidget *child; - GSList *children; - gint child_min, child_nat; *minimum = 0; *natural = 0; - for (children = priv->children; children; children = children->next) + if (priv->main_widget) { - child = children->data; - - if (!gtk_widget_get_visible (child)) - continue; - - gtk_widget_get_preferred_width (child, &child_min, &child_nat); - - *minimum = MAX (*minimum, child_min); - *natural = MAX (*natural, child_nat); + gtk_widget_get_preferred_width (priv->main_widget, minimum, natural); } } @@ -177,24 +166,13 @@ gedit_overlay_get_preferred_height (GtkWidget *widget, gint *natural) { GeditOverlayPrivate *priv = GEDIT_OVERLAY (widget)->priv; - GtkWidget *child; - GSList *children; - gint child_min, child_nat; *minimum = 0; *natural = 0; - for (children = priv->children; children; children = children->next) + if (priv->main_widget) { - child = children->data; - - if (!gtk_widget_get_visible (child)) - continue; - - gtk_widget_get_preferred_height (child, &child_min, &child_nat); - - *minimum = MAX (*minimum, child_min); - *natural = MAX (*natural, child_nat); + gtk_widget_get_preferred_height (priv->main_widget, minimum, natural); } } -- cgit v1.2.3