@@ -128,10 +128,27 @@ - (id)initWithVimController:(MMVimController *)controller
128
128
{
129
129
backgroundDark = NO ;
130
130
131
- unsigned styleMask = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable
132
- | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable
133
- | NSWindowStyleMaskUnifiedTitleAndToolbar
134
- | NSWindowStyleMaskTexturedBackground ;
131
+ unsigned styleMask = NSWindowStyleMaskTitled
132
+ | NSWindowStyleMaskClosable
133
+ | NSWindowStyleMaskMiniaturizable
134
+ | NSWindowStyleMaskResizable
135
+ | NSWindowStyleMaskUnifiedTitleAndToolbar;
136
+
137
+ // Textured background has been a deprecated feature for a while. For a
138
+ // while we kept using it to avoid showing a black line below the title
139
+ // bar, but since macOS 11.0 this flag is completely ignored and
140
+ // deprecated. Since it's hard to test older versions of macOS well, simply
141
+ // preserve the existing functionality on older macOS versions, while not
142
+ // setting it in macOS 11+.
143
+ BOOL usingTexturedBackground = NO ;
144
+ #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_VERSION_11_0
145
+ if (@available (macos 11.0 , *)) {
146
+ // Don't set the textured background because it's been completely deprecated and won't do anything.
147
+ } else {
148
+ styleMask = styleMask | NSWindowStyleMaskTexturedBackground ;
149
+ usingTexturedBackground = YES ;
150
+ }
151
+ #endif
135
152
136
153
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults ];
137
154
if ([userDefaults boolForKey: MMNoTitleBarWindowKey]) {
@@ -179,7 +196,7 @@ - (id)initWithVimController:(MMVimController *)controller
179
196
[win setDelegate: self ];
180
197
[win setInitialFirstResponder: [vimView textView ]];
181
198
182
- if ([win styleMask ] & NSWindowStyleMaskTexturedBackground ) {
199
+ if (usingTexturedBackground ) {
183
200
// On Leopard, we want to have a textured window to have nice
184
201
// looking tabs. But the textured window look implies rounded
185
202
// corners, which looks really weird -- disable them. This is a
@@ -1722,10 +1739,18 @@ - (void)updateTablineSeparator
1722
1739
{
1723
1740
BOOL tabBarVisible = ![[vimView tabBarControl ] isHidden ];
1724
1741
BOOL toolbarHidden = [decoratedWindow toolbar ] == nil ;
1725
- BOOL windowTextured = ([decoratedWindow styleMask ] &
1726
- NSWindowStyleMaskTexturedBackground ) != 0 ;
1727
1742
BOOL hideSeparator = NO ;
1728
1743
1744
+ // See initWithVimController: for textured background deprecation notes.
1745
+ BOOL windowTextured = NO ;
1746
+ #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_VERSION_11_0
1747
+ if (@available (macos 11.0 , *)) {
1748
+ } else {
1749
+ windowTextured = ([decoratedWindow styleMask ] &
1750
+ NSWindowStyleMaskTexturedBackground ) != 0 ;
1751
+ }
1752
+ #endif
1753
+
1729
1754
if (floor (NSAppKitVersionNumber ) >= NSAppKitVersionNumber10_10 ) {
1730
1755
// The tabline separator is mostly an old feature and not necessary
1731
1756
// modern macOS versions.
0 commit comments