X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2FAppleSupport.m;h=7657e9db974e722e2d042eafc795571d190b2c3c;hb=7b0f9d95248820bc70b820dd6b558de4a6713bae;hp=edbede487f253c3edc3d2c6b8a8171d795c21205;hpb=292799a4bd3fead1d631678a94a4eccc89193201;p=lyx.git diff --git a/src/support/AppleSupport.m b/src/support/AppleSupport.m index edbede487f..7657e9db97 100644 --- a/src/support/AppleSupport.m +++ b/src/support/AppleSupport.m @@ -24,12 +24,21 @@ void appleCleanupEditMenu() { void appleCleanupViewMenu() { -#ifdef AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER // Remove the "Show Tab Bar" menu item from the "View" menu, if supported + // See the Apple developer release notes: + // What should an application which already has support for tabbing do? + // - The application should explicitly opt-out of automatic window tabbing... + // It should respect the userTabbingPreference... see below + // https://developer.apple.com/library/archive/releasenotes/AppKit/RN-AppKitOlderNotes/index.html if ([NSWindow respondsToSelector:@selector(allowsAutomaticWindowTabbing)]) - NSWindow.allowsAutomaticWindowTabbing = NO; -#endif + [NSWindow setAllowsAutomaticWindowTabbing:NO]; // Remove the "Enter Full Screen" menu item from the "View" menu [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"]; } + + +bool appleUserTabbingPreferenceAlways() { + return [NSWindow respondsToSelector:@selector(userTabbingPreference)] && + [NSWindow userTabbingPreference] == NSWindowUserTabbingPreferenceAlways; +}