Skip to content

Commit b397052

Browse files
authored
Merge pull request #811 from ychin/startup-nonnative-fullscreen-fix
Fix starting up in non-native fullscreen resulting in black screen
2 parents d6f259e + b6bc72b commit b397052

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/MacVim/MMCoreTextView.m

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,13 @@ - (id)initWithFrame:(NSRect)frame
137137
boolForKey:MMBufferedDrawingKey];
138138
cgBufferDrawNeedsUpdateContext = NO;
139139

140-
cgLayerEnabled = [[NSUserDefaults standardUserDefaults]
141-
boolForKey:MMUseCGLayerAlwaysKey];
140+
cgLayerEnabled = NO;
141+
if (!cgBufferDrawEnabled) {
142+
// Buffered draw supercedes the CGLayer renderer, which is deprecated
143+
// and doesn't actually work in 10.14+.
144+
cgLayerEnabled = [[NSUserDefaults standardUserDefaults]
145+
boolForKey:MMUseCGLayerAlwaysKey];
146+
}
142147
cgLayerLock = [NSLock new];
143148

144149
// NOTE! It does not matter which font is set here, Vim will set its
@@ -795,7 +800,7 @@ - (void)performBatchDrawWithData:(NSData *)data
795800

796801
- (void)setCGLayerEnabled:(BOOL)enabled
797802
{
798-
if (cgContext)
803+
if (cgContext || cgBufferDrawEnabled)
799804
return;
800805

801806
cgLayerEnabled = enabled;

src/MacVim/MMWindowController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ - (BOOL)presentWindow:(id)unused
348348
// GUIEnter auto command could cause this).
349349
[fullScreenWindow enterFullScreen];
350350
fullScreenEnabled = YES;
351+
shouldResizeVimView = YES;
351352
} else if (delayEnterFullScreen) {
352353
// Set alpha to zero so that the decorated window doesn't pop up
353354
// before we enter full-screen.

0 commit comments

Comments
 (0)