diff --git a/src/MacVim/MMWindowController.h b/src/MacVim/MMWindowController.h index 26feb38774..8c92ed537d 100644 --- a/src/MacVim/MMWindowController.h +++ b/src/MacVim/MMWindowController.h @@ -40,6 +40,7 @@ int userCols; NSPoint userTopLeft; NSPoint defaultTopLeft; + NSSize desiredWindowSize; NSToolbar *toolbar; BOOL resizingDueToMove; int blurRadius; diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index 8a966793b2..25ccffeb96 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -594,11 +594,12 @@ // TODO: What if the resize message fails to make it back? if (!didMaximize) { NSSize originalSize = [vimView frame].size; - NSSize contentSize = [vimView desiredSize]; - contentSize = [self constrainContentSizeToScreenSize:contentSize]; int rows = 0, cols = 0; - contentSize = [vimView constrainRows:&rows columns:&cols - toSize:contentSize]; + NSSize contentSize = [vimView constrainRows:&rows columns:&cols + toSize: + fullScreenWindow ? [fullScreenWindow frame].size : + fullScreenEnabled ? desiredWindowSize : + [self constrainContentSizeToScreenSize:[vimView desiredSize]]]; [vimView setFrameSize:contentSize]; if (fullScreenWindow) { @@ -1003,6 +1004,11 @@ [vimController sendMessage:SetWindowPositionMsgID data:data]; } +- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)frameSize { + desiredWindowSize = frameSize; + return frameSize; +} + - (void)windowDidResize:(id)sender { if (resizingDueToMove) {