File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 114114- (NSRect )rectForRow : (int )row column : (int )column numRows : (int )nr
115115 numColumns : (int )nc ;
116116- (void )setCGLayerEnabled : (BOOL )enabled ;
117+ - (BOOL )getCGLayerEnabled ;
117118
118119//
119120// NSTextView methods
Original file line number Diff line number Diff line change @@ -809,6 +809,11 @@ - (void)setCGLayerEnabled:(BOOL)enabled
809809 [self releaseCGLayer ];
810810}
811811
812+ - (BOOL )getCGLayerEnabled
813+ {
814+ return cgLayerEnabled;
815+ }
816+
812817- (void )releaseCGLayer
813818{
814819 if (cgLayer) {
Original file line number Diff line number Diff line change 3434 // Controls the speed of the fade in and out.
3535 double fadeTime;
3636 double fadeReservationTime;
37+
38+ // For pre-10.14 we manually sets CGLayer mode, so need to remember the original state
39+ BOOL origCGLayerEnabled;
3740}
3841
3942- (MMFullScreenWindow *)initWithWindow : (NSWindow *)t view : (MMVimView *)v
Original file line number Diff line number Diff line change @@ -113,6 +113,8 @@ - (MMFullScreenWindow *)initWithWindow:(NSWindow *)t view:(MMVimView *)v
113113 fadeTime = MIN (fadeTime, 0.5 * (kCGMaxDisplayReservationInterval - 1 ));
114114 fadeReservationTime = 2.0 * fadeTime + 1 ;
115115
116+ origCGLayerEnabled = NO ;
117+
116118 return self;
117119}
118120
@@ -172,8 +174,11 @@ - (void)enterFullScreen
172174 oldPosition = [view frame ].origin ;
173175
174176 [view removeFromSuperviewWithoutNeedingDisplay ];
175- if (floor (NSAppKitVersionNumber ) >= NSAppKitVersionNumber10_12 )
177+ if (floor (NSAppKitVersionNumber ) >= NSAppKitVersionNumber10_12 ) {
178+ // This shouldn't do much in 10.14+.
179+ origCGLayerEnabled = [[view textView ] getCGLayerEnabled ];
176180 [[view textView ] setCGLayerEnabled: YES ];
181+ }
177182 [[self contentView ] addSubview: view];
178183 [self setInitialFirstResponder: [view textView ]];
179184
@@ -289,7 +294,7 @@ - (void)leaveFullScreen
289294 [self close ];
290295
291296 if (floor (NSAppKitVersionNumber ) >= NSAppKitVersionNumber10_12 )
292- [[view textView ] setCGLayerEnabled: NO ];
297+ [[view textView ] setCGLayerEnabled: origCGLayerEnabled ];
293298
294299 // Set the text view to initial first responder, otherwise the 'plus'
295300 // button on the tabline steals the first responder status.
Original file line number Diff line number Diff line change 7474- (void )deleteSign : (NSString *)signName ;
7575- (void )setToolTipAtMousePoint : (NSString *)string ;
7676- (void )setCGLayerEnabled : (BOOL )enabled ;
77+ - (BOOL )getCGLayerEnabled ;
7778@end
Original file line number Diff line number Diff line change @@ -527,6 +527,11 @@ - (void)setCGLayerEnabled:(BOOL)enabled
527527 // ONLY in Core Text!
528528}
529529
530+ - (BOOL )getCGLayerEnabled
531+ {
532+ return NO ;
533+ }
534+
530535- (BOOL )isOpaque
531536{
532537 return NO ;
Original file line number Diff line number Diff line change @@ -200,6 +200,15 @@ - (id)initWithVimController:(MMVimController *)controller
200200 // Make us safe on pre-tiger OSX
201201 if ([win respondsToSelector: @selector (_setContentHasShadow: )])
202202 [win _setContentHasShadow: NO ];
203+
204+ if (!(styleMask & NSWindowStyleMaskTitled)) {
205+ // In the no titlebar mode (aka borderless), we need to set CGLayer
206+ // mode since otherwise the legacy renderer would not render properly.
207+ // For more reference see MMFullscreenWindow's enterFullscreen:
208+ // This shouldn't do much in 10.14+.
209+ if (floor (NSAppKitVersionNumber ) >= NSAppKitVersionNumber10_12 )
210+ [[vimView textView ] setCGLayerEnabled: YES ];
211+ }
203212
204213#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
205214 // Building on Mac OS X 10.7 or greater.
You can’t perform that action at this time.
0 commit comments