diff options
author | Stuart Connolly <stuart02@gmail.com> | 2017-03-25 21:25:57 +0000 |
---|---|---|
committer | Stuart Connolly <stuart02@gmail.com> | 2017-03-25 21:25:57 +0000 |
commit | 430ff7b0c1df70891a31eb27ba93a5d6b2e1a0d1 (patch) | |
tree | 8e2643ef51a6b0ebe67bf28f3ee95eb52125c375 | |
parent | 02447c6d03d0bc3740f87109dcb7b436fa6060e8 (diff) | |
download | sequelpro-430ff7b0c1df70891a31eb27ba93a5d6b2e1a0d1.tar.gz sequelpro-430ff7b0c1df70891a31eb27ba93a5d6b2e1a0d1.tar.bz2 sequelpro-430ff7b0c1df70891a31eb27ba93a5d6b2e1a0d1.zip |
Disable automatic window tabbing on 10.12+ until we fully implement it.
-rw-r--r-- | Source/SPConstants.h | 17 | ||||
-rw-r--r-- | Source/SPWindow.m | 18 |
2 files changed, 28 insertions, 7 deletions
diff --git a/Source/SPConstants.h b/Source/SPConstants.h index 161b5b0b..71b0c49b 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -665,18 +665,25 @@ typedef NS_ENUM(NSInteger,SPErrorCode) { // error codes in SPErrorDomain void _SPClear(id *addr); #define SPClear(x) _SPClear(&x) -//Backwards compatibility +// Backwards compatibility #ifndef __MAC_10_7 -#define __MAC_10_7 1070 + #define __MAC_10_7 1070 #endif + #ifndef __MAC_10_8 -#define __MAC_10_8 1080 + #define __MAC_10_8 1080 #endif + #ifndef __MAC_10_10 -#define __MAC_10_10 101000 + #define __MAC_10_10 101000 #endif + #ifndef __MAC_10_11 -#define __MAC_10_11 101100 + #define __MAC_10_11 101100 +#endif + +#ifndef __MAC_10_12 + #define __MAC_10_12 101200 #endif // This enum is available since 10.5 but only got a "name" in 10.10 diff --git a/Source/SPWindow.m b/Source/SPWindow.m index cda7eb63..383b7fcd 100644 --- a/Source/SPWindow.m +++ b/Source/SPWindow.m @@ -32,7 +32,9 @@ #import "SPWindowController.h" @interface NSWindow (LionPlusMethods) + - (void)toggleFullScreen:(id)sender; + @end @implementation SPWindow @@ -40,6 +42,18 @@ @synthesize isSheetWhichCanBecomeMain; #pragma mark - + ++ (void)initialize +{ +#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_12 + // Disable automatic window tabbing on 10.12+ + if ([NSWindow respondsToSelector:@selector(setAllowsAutomaticWindowTabbing:)]) { + [NSWindow setAllowsAutomaticWindowTabbing:NO]; + } +#endif +} + +#pragma mark - #pragma mark Keyboard shortcut additions /** @@ -140,7 +154,9 @@ { if ([[self windowController] respondsToSelector:@selector(selectedTableDocument)]) { return [[[self windowController] selectedTableDocument] undoManager]; + } + return [super undoManager]; } @@ -153,7 +169,6 @@ */ - (BOOL)canBecomeMainWindow { - // If this window is a sheet which is permitted to become main, respond appropriately if ([self isSheet] && isSheetWhichCanBecomeMain) { return [self isVisible]; @@ -190,7 +205,6 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { - // If the item is the Show/Hide Toolbar menu item, override the text to allow correct translation if ([menuItem action] == @selector(toggleToolbarShown:)) { BOOL theResponse = [super validateMenuItem:menuItem]; |