@@ -543,7 +543,39 @@ - (void)setDefaultColorsBackground:(NSColor *)back foreground:(NSColor *)fore
543543 [decoratedWindow setOpaque: isOpaque];
544544 if (fullScreenWindow)
545545 [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
547579
548580 [vimView setDefaultColorsBackground: back foreground: fore];
549581}
@@ -758,8 +790,16 @@ - (void)enterFullScreen:(int)fuoptions backgroundColor:(NSColor *)back
758790 // times during startup.
759791 [fullScreenWindow release ];
760792
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+
761801 fullScreenWindow = [[MMFullScreenWindow alloc ]
762- initWithWindow: decoratedWindow view: vimView backgroundColor: back ];
802+ initWithWindow: decoratedWindow view: vimView backgroundColor: fullscreenBg ];
763803 [fullScreenWindow setOptions: fuoptions];
764804 [fullScreenWindow setRepresentedFilename:
765805 [decoratedWindow representedFilename ]];
@@ -1544,7 +1584,7 @@ - (void)updateTablineSeparator
15441584 BOOL windowTextured = ([decoratedWindow styleMask ] &
15451585 NSWindowStyleMaskTexturedBackground ) != 0 ;
15461586 BOOL hideSeparator = NO ;
1547-
1587+
15481588 if (floor (NSAppKitVersionNumber ) >= NSAppKitVersionNumber10_10 ) {
15491589 // The tabline separator is mostly an old feature and not necessary
15501590 // modern macOS versions.
0 commit comments