@@ -543,7 +543,39 @@ - (void)setDefaultColorsBackground:(NSColor *)back foreground:(NSColor *)fore
543
543
[decoratedWindow setOpaque: isOpaque];
544
544
if (fullScreenWindow)
545
545
[fullScreenWindow setOpaque: isOpaque];
546
- [decoratedWindow setBackgroundColor: back];
546
+
547
+ #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14
548
+ if (@available (macos 10.14 , *)) {
549
+ // We usually don't really need to change the background color of the
550
+ // window, but in 10.14+ we switched to using layer-backed drawing.
551
+ // That's fine except when we set 'transparency' to non-zero. The alpha
552
+ // is set on the text view, but it won't work if drawn on top of a solid
553
+ // window, so we need to set a transparency color here to make the
554
+ // transparency show through.
555
+ if ([back alphaComponent ] == 1 ) {
556
+ // Here, any solid color would do, but setting it with "back" has an
557
+ // interesting effect where the title bar gets subtly tinted by it
558
+ // as well, so do that. (Note that this won't play well in <=10.12
559
+ // since we are using the deprecated
560
+ // NSWindowStyleMaskTexturedBackground which makes the titlebars
561
+ // transparent in those. Consider not using textured background.)
562
+ [decoratedWindow setBackgroundColor: back];
563
+ if (fullScreenWindow) {
564
+ [fullScreenWindow setBackgroundColor: back];
565
+ }
566
+ } else {
567
+ // HACK! We really want a transparent background color to avoid
568
+ // double blending the transparency, but setting alpha=0 leads to
569
+ // the window border disappearing and also drag-to-resize becomes a
570
+ // lot slower. So hack around it by making it virtually transparent.
571
+ NSColor *clearColor = [back colorWithAlphaComponent: 0.001 ];
572
+ [decoratedWindow setBackgroundColor: clearColor];
573
+ if (fullScreenWindow) {
574
+ [fullScreenWindow setBackgroundColor: clearColor];
575
+ }
576
+ }
577
+ }
578
+ #endif
547
579
548
580
[vimView setDefaultColorsBackground: back foreground: fore];
549
581
}
@@ -758,8 +790,16 @@ - (void)enterFullScreen:(int)fuoptions backgroundColor:(NSColor *)back
758
790
// times during startup.
759
791
[fullScreenWindow release ];
760
792
793
+ NSColor *fullscreenBg = back;
794
+
795
+ // See setDefaultColorsBackground: for why set a transparent
796
+ // background color, and why 0.001 instead of 0.
797
+ if ([fullscreenBg alphaComponent ] != 1 ) {
798
+ fullscreenBg = [fullscreenBg colorWithAlphaComponent: 0.001 ];
799
+ }
800
+
761
801
fullScreenWindow = [[MMFullScreenWindow alloc ]
762
- initWithWindow: decoratedWindow view: vimView backgroundColor: back ];
802
+ initWithWindow: decoratedWindow view: vimView backgroundColor: fullscreenBg ];
763
803
[fullScreenWindow setOptions: fuoptions];
764
804
[fullScreenWindow setRepresentedFilename:
765
805
[decoratedWindow representedFilename ]];
@@ -1544,7 +1584,7 @@ - (void)updateTablineSeparator
1544
1584
BOOL windowTextured = ([decoratedWindow styleMask ] &
1545
1585
NSWindowStyleMaskTexturedBackground ) != 0 ;
1546
1586
BOOL hideSeparator = NO ;
1547
-
1587
+
1548
1588
if (floor (NSAppKitVersionNumber ) >= NSAppKitVersionNumber10_10 ) {
1549
1589
// The tabline separator is mostly an old feature and not necessary
1550
1590
// modern macOS versions.
0 commit comments