diff --git a/Source/GSWindowDecorationView.m b/Source/GSWindowDecorationView.m index e09e697a5..6705cb014 100644 --- a/Source/GSWindowDecorationView.m +++ b/Source/GSWindowDecorationView.m @@ -353,20 +353,42 @@ static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor) { NSRect orgWindowFrame; NSRect windowFrame; + NSRect windowContentFrame; - if (difference != 0.0) + // FIXME: This is needed as long as NSWindow uses fraem limits not content frame limits + NSSize aSize = [window minSize]; + if (!NSEqualSizes(aSize, NSZeroSize)) { + aSize.height += difference; + [window setMinSize: aSize]; + } + aSize = [window maxSize]; + if (!NSEqualSizes(aSize, NSZeroSize)) + { + aSize.height += difference; + [window setMaxSize: aSize]; + } + contentRect.size.height += difference; + windowFrame = [object_getClass(self) + frameRectForContentRect: contentRect + styleMask: [window styleMask]]; + // Set the local frame without changing the contents view + windowContentFrame = windowFrame; + windowContentFrame.origin = NSZeroPoint; + _autoresizes_subviews = NO; + [super setFrame: windowContentFrame]; + // Keep the top of the window at the same place orgWindowFrame = [window frame]; - windowFrame = orgWindowFrame; windowFrame.origin.y = orgWindowFrame.origin.y + orgWindowFrame.size.height - windowFrame.size.height; windowFrame.origin.x = orgWindowFrame.origin.x; - windowFrame.size.height += difference; + + // then resize the window [window setFrame: windowFrame display: YES]; + [self layout]; } -} /* * Special setFrame: implementation - a minimal autoresize mechanism