From 1ce1cb48d37f04addb090bd90e9ccea61d893c0a Mon Sep 17 00:00:00 2001 From: Kazuki Sakamoto Date: Fri, 9 Oct 2015 16:02:37 -0700 Subject: [PATCH 1/3] Fix rendering issue in Split View on El Capitan --- src/MacVim/MMWindowController.m | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index 89ab5da117..6870f235f0 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -1021,13 +1021,19 @@ - (void)windowDidMove:(NSNotification *)notification - (void)windowDidResize:(id)sender { - if (resizingDueToMove) - { + if (resizingDueToMove) { resizingDueToMove = NO; return; } - if (!setupDone || fullScreenEnabled) return; + if (!setupDone) + return; + + // NOTE: We need to update the window frame size for Split View even though + // in full-screen on El Capitan or later. + if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_10_Max + && fullScreenEnabled) + return; // NOTE: Since we have no control over when the window may resize (Cocoa // may resize automatically) we simply set the view to fill the entire From 2c51e2ce8dfdda66347fbb93cef740e8c18fe401 Mon Sep 17 00:00:00 2001 From: Kazuki Sakamoto Date: Fri, 9 Oct 2015 22:51:37 -0700 Subject: [PATCH 2/3] Fix full-screen redraw issues on El Capitan On El Capitan, we need to redraw the view when entering full-screen using :fullscreen option (including Ctrl-Cmd-f), and leaving full-screen by moving the window out from Split View. --- src/MacVim/MMWindowController.m | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index 6870f235f0..dd70f89fb1 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -1218,6 +1218,24 @@ - (void)windowWillEnterFullScreen:(NSNotification *)notification } } +- (void)windowDidEnterFullScreen:(NSNotification *)notification +{ + if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_10_Max) { + // NOTE: On El Capitan, we need to redraw the view when entering + // full-screen using :fullscreen option (including Ctrl-Cmd-f). + [vimController sendMessage:BackingPropertiesChangedMsgID data:nil]; + } +} + +- (void)windowDidExitFullScreen:(NSNotification *)notification +{ + if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_10_Max) { + // NOTE: On El Capitan, we need to redraw the view when leaving + // full-screen by moving the window out from Split View. + [vimController sendMessage:BackingPropertiesChangedMsgID data:nil]; + } +} + - (void)windowDidFailToEnterFullScreen:(NSWindow *)window { // NOTE: This message can be called without From 13b3544fdaf2c10a6d08839093f0f7297b5f0be1 Mon Sep 17 00:00:00 2001 From: Kazuki Sakamoto Date: Sat, 10 Oct 2015 00:39:42 -0700 Subject: [PATCH 3/3] Reorder methods --- src/MacVim/MMWindowController.m | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index dd70f89fb1..6734f4e079 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -1227,15 +1227,6 @@ - (void)windowDidEnterFullScreen:(NSNotification *)notification } } -- (void)windowDidExitFullScreen:(NSNotification *)notification -{ - if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_10_Max) { - // NOTE: On El Capitan, we need to redraw the view when leaving - // full-screen by moving the window out from Split View. - [vimController sendMessage:BackingPropertiesChangedMsgID data:nil]; - } -} - - (void)windowDidFailToEnterFullScreen:(NSWindow *)window { // NOTE: This message can be called without @@ -1304,6 +1295,15 @@ - (void)windowWillExitFullScreen:(NSNotification *)notification } } +- (void)windowDidExitFullScreen:(NSNotification *)notification +{ + if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_10_Max) { + // NOTE: On El Capitan, we need to redraw the view when leaving + // full-screen by moving the window out from Split View. + [vimController sendMessage:BackingPropertiesChangedMsgID data:nil]; + } +} + - (void)windowDidFailToExitFullScreen:(NSWindow *)window { // TODO: Is this the correct way to deal with this message? Are we still