File tree Expand file tree Collapse file tree 7 files changed +31
-2
lines changed Expand file tree Collapse file tree 7 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 114
114
- (NSRect )rectForRow : (int )row column : (int )column numRows : (int )nr
115
115
numColumns : (int )nc ;
116
116
- (void )setCGLayerEnabled : (BOOL )enabled ;
117
+ - (BOOL )getCGLayerEnabled ;
117
118
118
119
//
119
120
// NSTextView methods
Original file line number Diff line number Diff line change @@ -809,6 +809,11 @@ - (void)setCGLayerEnabled:(BOOL)enabled
809
809
[self releaseCGLayer ];
810
810
}
811
811
812
+ - (BOOL )getCGLayerEnabled
813
+ {
814
+ return cgLayerEnabled;
815
+ }
816
+
812
817
- (void )releaseCGLayer
813
818
{
814
819
if (cgLayer) {
Original file line number Diff line number Diff line change 34
34
// Controls the speed of the fade in and out.
35
35
double fadeTime;
36
36
double fadeReservationTime;
37
+
38
+ // For pre-10.14 we manually sets CGLayer mode, so need to remember the original state
39
+ BOOL origCGLayerEnabled;
37
40
}
38
41
39
42
- (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
113
113
fadeTime = MIN (fadeTime, 0.5 * (kCGMaxDisplayReservationInterval - 1 ));
114
114
fadeReservationTime = 2.0 * fadeTime + 1 ;
115
115
116
+ origCGLayerEnabled = NO ;
117
+
116
118
return self;
117
119
}
118
120
@@ -172,8 +174,11 @@ - (void)enterFullScreen
172
174
oldPosition = [view frame ].origin ;
173
175
174
176
[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 ];
176
180
[[view textView ] setCGLayerEnabled: YES ];
181
+ }
177
182
[[self contentView ] addSubview: view];
178
183
[self setInitialFirstResponder: [view textView ]];
179
184
@@ -289,7 +294,7 @@ - (void)leaveFullScreen
289
294
[self close ];
290
295
291
296
if (floor (NSAppKitVersionNumber ) >= NSAppKitVersionNumber10_12 )
292
- [[view textView ] setCGLayerEnabled: NO ];
297
+ [[view textView ] setCGLayerEnabled: origCGLayerEnabled ];
293
298
294
299
// Set the text view to initial first responder, otherwise the 'plus'
295
300
// button on the tabline steals the first responder status.
Original file line number Diff line number Diff line change 74
74
- (void )deleteSign : (NSString *)signName ;
75
75
- (void )setToolTipAtMousePoint : (NSString *)string ;
76
76
- (void )setCGLayerEnabled : (BOOL )enabled ;
77
+ - (BOOL )getCGLayerEnabled ;
77
78
@end
Original file line number Diff line number Diff line change @@ -527,6 +527,11 @@ - (void)setCGLayerEnabled:(BOOL)enabled
527
527
// ONLY in Core Text!
528
528
}
529
529
530
+ - (BOOL )getCGLayerEnabled
531
+ {
532
+ return NO ;
533
+ }
534
+
530
535
- (BOOL )isOpaque
531
536
{
532
537
return NO ;
Original file line number Diff line number Diff line change @@ -200,6 +200,15 @@ - (id)initWithVimController:(MMVimController *)controller
200
200
// Make us safe on pre-tiger OSX
201
201
if ([win respondsToSelector: @selector (_setContentHasShadow: )])
202
202
[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
+ }
203
212
204
213
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
205
214
// Building on Mac OS X 10.7 or greater.
You can’t perform that action at this time.
0 commit comments