summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-icon-container.c
diff options
context:
space:
mode:
authorAlex Larsson <alexl@redhat.com>2002-05-30 19:12:03 +0000
committerAlexander Larsson <alexl@src.gnome.org>2002-05-30 19:12:03 +0000
commit3aec5152a8640fcae7e0164a0c0987f54e688e92 (patch)
tree03e777ece2871d9fb4919291a5bd06334b2efa8f /libnautilus-private/nautilus-icon-container.c
parent6eb3b56756d412751a8d968a2213cc3ee179afda (diff)
downloadnautilus-3aec5152a8640fcae7e0164a0c0987f54e688e92.tar.gz
Don't relayout when window height changes unless we need it. Based on a
2002-05-30 Alex Larsson <alexl@redhat.com> * 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 <jorgen.viksell@telia.com>
Diffstat (limited to 'libnautilus-private/nautilus-icon-container.c')
-rw-r--r--libnautilus-private/nautilus-icon-container.c21
1 files changed, 8 insertions, 13 deletions
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);
}
}