Skip to content

Commit 23c70e0

Browse files
authored
Merge pull request #495 from s4y/s4y/fullscreen_contentSize
Fix changing font size in full screen.
2 parents 487dd9d + 6d2e8f8 commit 23c70e0

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/MacVim/MMWindowController.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
int userCols;
4141
NSPoint userTopLeft;
4242
NSPoint defaultTopLeft;
43+
NSSize desiredWindowSize;
4344
NSToolbar *toolbar;
4445
BOOL resizingDueToMove;
4546
int blurRadius;

src/MacVim/MMWindowController.m

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -594,11 +594,12 @@ - (void)processInputQueueDidFinish
594594
// TODO: What if the resize message fails to make it back?
595595
if (!didMaximize) {
596596
NSSize originalSize = [vimView frame].size;
597-
NSSize contentSize = [vimView desiredSize];
598-
contentSize = [self constrainContentSizeToScreenSize:contentSize];
599597
int rows = 0, cols = 0;
600-
contentSize = [vimView constrainRows:&rows columns:&cols
601-
toSize:contentSize];
598+
NSSize contentSize = [vimView constrainRows:&rows columns:&cols
599+
toSize:
600+
fullScreenWindow ? [fullScreenWindow frame].size :
601+
fullScreenEnabled ? desiredWindowSize :
602+
[self constrainContentSizeToScreenSize:[vimView desiredSize]]];
602603
[vimView setFrameSize:contentSize];
603604

604605
if (fullScreenWindow) {
@@ -1003,6 +1004,11 @@ - (void)windowDidMove:(NSNotification *)notification
10031004
[vimController sendMessage:SetWindowPositionMsgID data:data];
10041005
}
10051006

1007+
- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)frameSize {
1008+
desiredWindowSize = frameSize;
1009+
return frameSize;
1010+
}
1011+
10061012
- (void)windowDidResize:(id)sender
10071013
{
10081014
if (resizingDueToMove) {

0 commit comments

Comments
 (0)