Skip to content

Commit e784f74

Browse files
committed
Merge pull request #86 from macvim-dev/fix/el-capitan-split-view-issue
Fix rendering issue in Split View on El Capitan
2 parents 5b2209b + 13b3544 commit e784f74

1 file changed

Lines changed: 27 additions & 3 deletions

File tree

src/MacVim/MMWindowController.m

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,13 +1021,19 @@ - (void)windowDidMove:(NSNotification *)notification
10211021

10221022
- (void)windowDidResize:(id)sender
10231023
{
1024-
if (resizingDueToMove)
1025-
{
1024+
if (resizingDueToMove) {
10261025
resizingDueToMove = NO;
10271026
return;
10281027
}
10291028

1030-
if (!setupDone || fullScreenEnabled) return;
1029+
if (!setupDone)
1030+
return;
1031+
1032+
// NOTE: We need to update the window frame size for Split View even though
1033+
// in full-screen on El Capitan or later.
1034+
if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_10_Max
1035+
&& fullScreenEnabled)
1036+
return;
10311037

10321038
// NOTE: Since we have no control over when the window may resize (Cocoa
10331039
// may resize automatically) we simply set the view to fill the entire
@@ -1212,6 +1218,15 @@ - (void)windowWillEnterFullScreen:(NSNotification *)notification
12121218
}
12131219
}
12141220

1221+
- (void)windowDidEnterFullScreen:(NSNotification *)notification
1222+
{
1223+
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_10_Max) {
1224+
// NOTE: On El Capitan, we need to redraw the view when entering
1225+
// full-screen using :fullscreen option (including Ctrl-Cmd-f).
1226+
[vimController sendMessage:BackingPropertiesChangedMsgID data:nil];
1227+
}
1228+
}
1229+
12151230
- (void)windowDidFailToEnterFullScreen:(NSWindow *)window
12161231
{
12171232
// NOTE: This message can be called without
@@ -1280,6 +1295,15 @@ - (void)windowWillExitFullScreen:(NSNotification *)notification
12801295
}
12811296
}
12821297

1298+
- (void)windowDidExitFullScreen:(NSNotification *)notification
1299+
{
1300+
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_10_Max) {
1301+
// NOTE: On El Capitan, we need to redraw the view when leaving
1302+
// full-screen by moving the window out from Split View.
1303+
[vimController sendMessage:BackingPropertiesChangedMsgID data:nil];
1304+
}
1305+
}
1306+
12831307
- (void)windowDidFailToExitFullScreen:(NSWindow *)window
12841308
{
12851309
// TODO: Is this the correct way to deal with this message? Are we still

0 commit comments

Comments
 (0)