From d355cb618ce8586e75a87918a8b7d16b3a06edef Mon Sep 17 00:00:00 2001 From: Akemi Date: Sat, 19 Aug 2017 15:19:23 +0200 Subject: osx: fix build on macOS 10.11 and earlier 98f5579 added a safeguard for the deactivation of the automatic tab bar but it still needs a compile time guard. add a forward declaration for the setAllowsAutomaticWindowTabbing method of NSWindow. Fixes #4783 --- osdep/macosx_compat.h | 5 +++++ osdep/macosx_menubar.m | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/osdep/macosx_compat.h b/osdep/macosx_compat.h index 2b75c7695e..0c2e87d14c 100644 --- a/osdep/macosx_compat.h +++ b/osdep/macosx_compat.h @@ -25,6 +25,11 @@ #include "osdep/macosx_versions.h" #if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12) + +@interface NSWindow (macOS10_12_SDK) ++ (void)setAllowsAutomaticWindowTabbing:(BOOL)allow; +@end + typedef NSUInteger NSWindowStyleMask; static const NSWindowStyleMask NSWindowStyleMaskClosable = NSClosableWindowMask; static const NSWindowStyleMask NSWindowStyleMaskTitled = NSTitledWindowMask; diff --git a/osdep/macosx_menubar.m b/osdep/macosx_menubar.m index b0ace205f3..4e9b1733d6 100644 --- a/osdep/macosx_menubar.m +++ b/osdep/macosx_menubar.m @@ -20,6 +20,7 @@ #import "macosx_menubar_objc.h" #import "osdep/macosx_application_objc.h" +#include "osdep/macosx_compat.h" @implementation MenuBar { @@ -34,8 +35,8 @@ [userDefaults setBool:YES forKey:@"NSDisabledDictationMenuItem"]; [userDefaults setBool:YES forKey:@"NSDisabledCharacterPaletteMenuItem"]; - if ([NSWindow respondsToSelector:@selector(allowsAutomaticWindowTabbing)]) - NSWindow.allowsAutomaticWindowTabbing = NO; + if ([NSWindow respondsToSelector:@selector(setAllowsAutomaticWindowTabbing:)]) + [NSWindow setAllowsAutomaticWindowTabbing: NO]; menuTree = @[ @{ -- cgit v1.2.3