@@ -699,25 +699,32 @@ - (void)setDefaultColorsBackground:(NSColor *)back foreground:(NSColor *)fore
699699 // window, so we need to set a transparency color here to make the
700700 // transparency show through.
701701 if ([back alphaComponent ] == 1 ) {
702- // Here, any solid color would do, but setting it with "back" has an
703- // interesting effect where the title bar gets subtly tinted by it
704- // as well, so do that. (Note that this won't play well in <=10.12
705- // since we are using the deprecated
706- // NSWindowStyleMaskTexturedBackground which makes the titlebars
707- // transparent in those. Consider not using textured background.)
702+ // The window's background color affects the title bar tint and
703+ // if we are using a transparent title bar this color will show
704+ // up as well.
705+ // (Note that this won't play well in <=10.12 since we are using
706+ // the deprecated NSWindowStyleMaskTexturedBackground which makes
707+ // the titlebars transparent in those. Consider not using textured
708+ // background.)
708709 [decoratedWindow setBackgroundColor: back];
710+
711+ // Note: We leave the full screen window's background color alone
712+ // because it is affected by 'fuoptions' instead. We just change the
713+ // alpha back to 1 in case it was changed previously because transparency
714+ // was set.
709715 if (fullScreenWindow) {
710- [fullScreenWindow setBackgroundColor: back];
716+ [fullScreenWindow setBackgroundColor:
717+ [fullScreenWindow.backgroundColor colorWithAlphaComponent: 1 ]];
711718 }
712719 } else {
713720 // HACK! We really want a transparent background color to avoid
714721 // double blending the transparency, but setting alpha=0 leads to
715722 // the window border disappearing and also drag-to-resize becomes a
716723 // lot slower. So hack around it by making it virtually transparent.
717- NSColor *clearColor = [back colorWithAlphaComponent: 0.001 ];
718- [decoratedWindow setBackgroundColor: clearColor];
724+ [decoratedWindow setBackgroundColor: [back colorWithAlphaComponent: 0.001 ]];
719725 if (fullScreenWindow) {
720- [fullScreenWindow setBackgroundColor: clearColor];
726+ [fullScreenWindow setBackgroundColor:
727+ [fullScreenWindow.backgroundColor colorWithAlphaComponent: 0.001 ]];
721728 }
722729 }
723730 }
@@ -1046,9 +1053,17 @@ - (void)leaveFullScreen
10461053 }
10471054}
10481055
1056+ // / Called when the window is in non-native full-screen mode and the user has
1057+ // / updated the background color.
10491058- (void )setFullScreenBackgroundColor : (NSColor *)back
10501059{
10511060 if (fullScreenWindow)
1061+ // See setDefaultColorsBackground: for why set a transparent
1062+ // background color, and why 0.001 instead of 0.
1063+ if ([back alphaComponent ] != 1 ) {
1064+ back = [back colorWithAlphaComponent: 0.001 ];
1065+ }
1066+
10521067 [fullScreenWindow setBackgroundColor: back];
10531068}
10541069
@@ -1307,9 +1322,7 @@ - (void)windowDidResize:(id)sender
13071322 // Calling setFrameSizeKeepGUISize: instead of setFrameSize: prevents a
13081323 // degenerate case where frameSizeMayHaveChanged: ends up resizing the window
13091324 // *again* causing windowDidResize: to be called.
1310- if (fullScreenWindow == nil ) {
1311- [vimView setFrameSizeKeepGUISize: [self contentSize ]];
1312- } else {
1325+ if (fullScreenEnabled && fullScreenWindow != nil ) {
13131326 // Non-native full screen mode is more complicated and needs to
13141327 // re-layout the Vim view to properly account for the menu bar / notch,
13151328 // and misc fuopt configuration.
@@ -1318,6 +1331,9 @@ - (void)windowDidResize:(id)sender
13181331 [vimView setFrameOrigin: desiredFrame.origin];
13191332 [vimView setFrameSizeKeepGUISize: desiredFrame.size];
13201333 }
1334+ else {
1335+ [vimView setFrameSizeKeepGUISize: [self contentSize ]];
1336+ }
13211337}
13221338
13231339- (void )windowDidChangeBackingProperties : (NSNotification *)notification
0 commit comments