From 555ff46538c86abb0ad150f3c9ef9fc26eae8c21 Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Tue, 2 Aug 2011 05:00:22 +0000 Subject: [PATCH] Check size limit of all stacked windows when resizing. Fixes #7893 thanks to diver (again). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42537 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/Window.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/servers/app/Window.cpp b/src/servers/app/Window.cpp index 46c86d0084..25d034f28b 100644 --- a/src/servers/app/Window.cpp +++ b/src/servers/app/Window.cpp @@ -340,15 +340,22 @@ Window::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion, bool resizeStack) int32 wantHeight = fFrame.IntegerHeight() + y; // enforce size limits - if (wantWidth < fMinWidth) - wantWidth = fMinWidth; - if (wantWidth > fMaxWidth) - wantWidth = fMaxWidth; + WindowStack* stack = GetWindowStack(); + if (resizeStack && stack) { + for (int32 i = 0; i < stack->CountWindows(); i++) { + Window* window = stack->WindowList().ItemAt(i); - if (wantHeight < fMinHeight) - wantHeight = fMinHeight; - if (wantHeight > fMaxHeight) - wantHeight = fMaxHeight; + if (wantWidth < window->fMinWidth) + wantWidth = window->fMinWidth; + if (wantWidth > window->fMaxWidth) + wantWidth = window->fMaxWidth; + + if (wantHeight < window->fMinHeight) + wantHeight = window->fMinHeight; + if (wantHeight > window->fMaxHeight) + wantHeight = window->fMaxHeight; + } + } x = wantWidth - fFrame.IntegerWidth(); y = wantHeight - fFrame.IntegerHeight(); @@ -371,7 +378,6 @@ Window::ResizeBy(int32 x, int32 y, BRegion* dirtyRegion, bool resizeStack) if (decorator && resizeStack) decorator->ResizeBy(x, y, dirtyRegion); - WindowStack* stack = GetWindowStack(); if (resizeStack && stack) { for (int32 i = 0; i < stack->CountWindows(); i++) { Window* window = stack->WindowList().ItemAt(i);