Skip to content

Commit

Permalink
Disable automatic window tabbing on 10.12+ until we fully implement it.
Browse files Browse the repository at this point in the history
  • Loading branch information
stuconnolly committed Mar 25, 2017
1 parent 02447c6 commit 430ff7b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
17 changes: 12 additions & 5 deletions Source/SPConstants.h
Expand Up @@ -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
Expand Down
18 changes: 16 additions & 2 deletions Source/SPWindow.m
Expand Up @@ -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

Expand Down Expand Up @@ -140,7 +154,9 @@ - (NSUndoManager *)undoManager
{
if ([[self windowController] respondsToSelector:@selector(selectedTableDocument)]) {
return [[[self windowController] selectedTableDocument] undoManager];

}

return [super undoManager];
}

Expand All @@ -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];
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit 430ff7b

Please sign in to comment.