Skip to content
Permalink
Browse files

Disable automatic window tabbing on 10.12+ until we fully implement it.

  • Loading branch information
stuconnolly committed Mar 25, 2017
1 parent 02447c6 commit 430ff7b0c1df70891a31eb27ba93a5d6b2e1a0d1
Showing with 28 additions and 7 deletions.
  1. +12 −5 Source/SPConstants.h
  2. +16 −2 Source/SPWindow.m
@@ -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
@@ -32,13 +32,27 @@
#import "SPWindowController.h"

@interface NSWindow (LionPlusMethods)

- (void)toggleFullScreen:(id)sender;

@end

@implementation SPWindow

@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 @@ - (NSUndoManager *)undoManager
{
if ([[self windowController] respondsToSelector:@selector(selectedTableDocument)]) {
return [[[self windowController] selectedTableDocument] undoManager];

}

return [super undoManager];
}

@@ -153,7 +169,6 @@ - (NSUndoManager *)undoManager
*/
- (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 @@ - (void)toggleFullScreen:(id)sender

- (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];

0 comments on commit 430ff7b

Please sign in to comment.
You can’t perform that action at this time.