From 3aec5152a8640fcae7e0164a0c0987f54e688e92 Mon Sep 17 00:00:00 2001 From: Alex Larsson Date: Thu, 30 May 2002 19:12:03 +0000 Subject: Don't relayout when window height changes unless we need it. Based on a MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2002-05-30 Alex Larsson * libnautilus-private/nautilus-icon-container.c (size_allocate): Don't relayout when window height changes unless we need it. Based on a patch by Jörgen Viksell --- libnautilus-private/nautilus-icon-container.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'libnautilus-private/nautilus-icon-container.c') diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c index e7c2b47b2..17689701f 100644 --- a/libnautilus-private/nautilus-icon-container.c +++ b/libnautilus-private/nautilus-icon-container.c @@ -2414,26 +2414,21 @@ size_allocate (GtkWidget *widget, need_layout_redone = !container->details->has_been_allocated; - /* FIXME bugzilla.gnome.org 47219: - * We shouldn't have to redo the layout when x, y, or height - * changes, only when width changes. However, just removing these - * tests causes a problem when you're vertically stretching a window - * taller than the size needed to display all contents (the whole - * batch of contents start moving down, centered in the extra space). - */ - if (allocation->x != widget->allocation.x - || allocation->width != widget->allocation.width - || allocation->y != widget->allocation.y - || allocation->height != widget->allocation.height) { + /* We have to relayout if the height grows, and the scrolled window + * is smaller than the allocation because otherwise we won't + * re-center the canvas. */ + if (allocation->width != widget->allocation.width || + (allocation->height > widget->allocation.height && + GTK_LAYOUT (widget)->height < (guint)allocation->height)) { need_layout_redone = TRUE; } - + GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation); container->details->has_been_allocated = TRUE; if (need_layout_redone) { - redo_layout (NAUTILUS_ICON_CONTAINER (widget)); + redo_layout (container); } } -- cgit v1.2.1