Skip to content

Commit

Permalink
Replace the existing four window actions for moving between displays …
Browse files Browse the repository at this point in the history
…with two. Spectacle will now iterate over the next or previous display.
  • Loading branch information
eczarny committed Aug 27, 2012
1 parent fc56f51 commit baf1579
Show file tree
Hide file tree
Showing 13 changed files with 159 additions and 297 deletions.
273 changes: 74 additions & 199 deletions Languages/en.lproj/SpectaclePreferencesWindow.xib

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions Resources/Property Lists/Defaults.plist
Expand Up @@ -22,14 +22,10 @@
<data>YnBsaXN0MDDUAQIDBAUGGRpYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoKQHCBESVSRudWxs1AkKCwwNDg8QViRjbGFzc1ltb2RpZmllcnNXa2V5Q29kZVRuYW1lgAMREQAQfIACXxAQTW92ZVRvVXBwZXJSaWdodNITFBUWWiRjbGFzc25hbWVYJGNsYXNzZXNdWmVyb0tpdEhvdEtleaIXGF1aZXJvS2l0SG90S2V5WE5TT2JqZWN0XxAPTlNLZXllZEFyY2hpdmVy0RscVHJvb3SAAQgRGiMtMjc8QktSXGRpa25wcoWKlZ6sr73G2NvgAAAAAAAAAQEAAAAAAAAAHQAAAAAAAAAAAAAAAAAAAOI=</data>
<key>MoveToLowerRight</key>
<data>YnBsaXN0MDDUAQIDBAUGGRpYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoKQHCBESVSRudWxs1AkKCwwNDg8QViRjbGFzc1ltb2RpZmllcnNXa2V5Q29kZVRuYW1lgAMREwAQfIACXxAQTW92ZVRvTG93ZXJSaWdodNITFBUWWiRjbGFzc25hbWVYJGNsYXNzZXNdWmVyb0tpdEhvdEtleaIXGF1aZXJvS2l0SG90S2V5WE5TT2JqZWN0XxAPTlNLZXllZEFyY2hpdmVy0RscVHJvb3SAAQgRGiMtMjc8QktSXGRpa25wcoWKlZ6sr73G2NvgAAAAAAAAAQEAAAAAAAAAHQAAAAAAAAAAAAAAAAAAAOI=</data>
<key>MoveToLeftDisplay</key>
<data>YnBsaXN0MDDUAQIDBAUGGRpYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoKQHCBESVSRudWxs1AkKCwwNDg8QViRjbGFzc1ltb2RpZmllcnNXa2V5Q29kZVRuYW1lgAMRGQAQe4ACXxARTW92ZVRvTGVmdERpc3BsYXnSExQVFlokY2xhc3NuYW1lWCRjbGFzc2VzXVplcm9LaXRIb3RLZXmiFxhdWmVyb0tpdEhvdEtleVhOU09iamVjdF8QD05TS2V5ZWRBcmNoaXZlctEbHFRyb290gAEIERojLTI3PEJLUlxkaWtucHKGi5afrbC+x9nc4QAAAAAAAAEBAAAAAAAAAB0AAAAAAAAAAAAAAAAAAADj</data>
<key>MoveToRightDisplay</key>
<data>YnBsaXN0MDDUAQIDBAUGGRpYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoKQHCBESVSRudWxs1AkKCwwNDg8QViRjbGFzc1ltb2RpZmllcnNXa2V5Q29kZVRuYW1lgAMRGQAQfIACXxASTW92ZVRvUmlnaHREaXNwbGF50hMUFRZaJGNsYXNzbmFtZVgkY2xhc3Nlc11aZXJvS2l0SG90S2V5ohcYXVplcm9LaXRIb3RLZXlYTlNPYmplY3RfEA9OU0tleWVkQXJjaGl2ZXLRGxxUcm9vdIABCBEaIy0yNzxCS1JcZGlrbnByh4yXoK6xv8ja3eIAAAAAAAABAQAAAAAAAAAdAAAAAAAAAAAAAAAAAAAA5A==</data>
<key>MoveToTopDisplay</key>
<data>YnBsaXN0MDDUAQIDBAUGGRpYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoKQHCBESVSRudWxs1AkKCwwNDg8QViRjbGFzc1ltb2RpZmllcnNXa2V5Q29kZVRuYW1lgAMRGQAQfoACXxAQTW92ZVRvVG9wRGlzcGxhedITFBUWWiRjbGFzc25hbWVYJGNsYXNzZXNdWmVyb0tpdEhvdEtleaIXGF1aZXJvS2l0SG90S2V5WE5TT2JqZWN0XxAPTlNLZXllZEFyY2hpdmVy0RscVHJvb3SAAQgRGiMtMjc8QktSXGRpa25wcoWKlZ6sr73G2NvgAAAAAAAAAQEAAAAAAAAAHQAAAAAAAAAAAAAAAAAAAOI=</data>
<key>MoveToBottomDisplay</key>
<data>YnBsaXN0MDDUAQIDBAUGGRpYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoKQHCBESVSRudWxs1AkKCwwNDg8QViRjbGFzc1ltb2RpZmllcnNXa2V5Q29kZVRuYW1lgAMRGQAQfYACXxATTW92ZVRvQm90dG9tRGlzcGxhedITFBUWWiRjbGFzc25hbWVYJGNsYXNzZXNdWmVyb0tpdEhvdEtleaIXGF1aZXJvS2l0SG90S2V5WE5TT2JqZWN0XxAPTlNLZXllZEFyY2hpdmVy0RscVHJvb3SAAQgRGiMtMjc8QktSXGRpa25wcoiNmKGvssDJ297jAAAAAAAAAQEAAAAAAAAAHQAAAAAAAAAAAAAAAAAAAOU=</data>
<key>MoveToNextDisplay</key>
<data>YnBsaXN0MDDUAQIDBAUGGRpYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoKQHCBESVSRudWxs1AkKCwwNDg8QViRjbGFzc1ltb2RpZmllcnNXa2V5Q29kZVRuYW1lgAMRGQAQfIACXxARTW92ZVRvTmV4dERpc3BsYXnSExQVFlokY2xhc3NuYW1lWCRjbGFzc2VzXVplcm9LaXRIb3RLZXmiFxhdWmVyb0tpdEhvdEtleVhOU09iamVjdF8QD05TS2V5ZWRBcmNoaXZlctEbHFRyb290gAEIERojLTI3PEJLUlxkaWtucHKGi5afrbC+x9nc4QAAAAAAAAEBAAAAAAAAAB0AAAAAAAAAAAAAAAAAAADj</data>
<key>MoveToPreviousDisplay</key>
<data>YnBsaXN0MDDUAQIDBAUGGRpYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoKQHCBESVSRudWxs1AkKCwwNDg8QViRjbGFzc1ltb2RpZmllcnNXa2V5Q29kZVRuYW1lgAMRGQAQe4ACXxAVTW92ZVRvUHJldmlvdXNEaXNwbGF50hMUFRZaJGNsYXNzbmFtZVgkY2xhc3Nlc11aZXJvS2l0SG90S2V5ohcYXVplcm9LaXRIb3RLZXlYTlNPYmplY3RfEA9OU0tleWVkQXJjaGl2ZXLRGxxUcm9vdIABCBEaIy0yNzxCS1JcZGlrbnByio+ao7G0wsvd4OUAAAAAAAABAQAAAAAAAAAdAAAAAAAAAAAAAAAAAAAA5w==</data>
<key>MoveToNextThird</key>
<data>YnBsaXN0MDDUAQIDBAUGGRpYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoKQHCBESVSRudWxs1AkKCwwNDg8QViRjbGFzc1ltb2RpZmllcnNXa2V5Q29kZVRuYW1lgAMRGAAQfIACXxAPTW92ZVRvTmV4dFRoaXJk0hMUFRZaJGNsYXNzbmFtZVgkY2xhc3Nlc11aZXJvS2l0SG90S2V5ohcYXVplcm9LaXRIb3RLZXlYTlNPYmplY3RfEA9OU0tleWVkQXJjaGl2ZXLRGxxUcm9vdIABCBEaIy0yNzxCS1JcZGlrbnByhImUnauuvMXX2t8AAAAAAAABAQAAAAAAAAAdAAAAAAAAAAAAAAAAAAAA4Q==</data>
<key>MoveToPreviousThird</key>
Expand Down
6 changes: 2 additions & 4 deletions Resources/Property Lists/HotKeyNames.plist
Expand Up @@ -12,10 +12,8 @@
<string>MoveToLowerLeft</string>
<string>MoveToUpperRight</string>
<string>MoveToLowerRight</string>
<string>MoveToLeftDisplay</string>
<string>MoveToRightDisplay</string>
<string>MoveToTopDisplay</string>
<string>MoveToBottomDisplay</string>
<string>MoveToNextDisplay</string>
<string>MoveToPreviousDisplay</string>
<string>MoveToNextThird</string>
<string>MoveToPreviousThird</string>
<string>UndoLastMove</string>
Expand Down
6 changes: 2 additions & 4 deletions SpectacleConstants.h
Expand Up @@ -24,10 +24,8 @@
#define SpectacleWindowActionMoveToUpperRight @"MoveToUpperRight"
#define SpectacleWindowActionMoveToLowerRight @"MoveToLowerRight"

#define SpectacleWindowActionMoveToLeftDisplay @"MoveToLeftDisplay"
#define SpectacleWindowActionMoveToRightDisplay @"MoveToRightDisplay"
#define SpectacleWindowActionMoveToTopDisplay @"MoveToTopDisplay"
#define SpectacleWindowActionMoveToBottomDisplay @"MoveToBottomDisplay"
#define SpectacleWindowActionMoveToNextDisplay @"MoveToNextDisplay"
#define SpectacleWindowActionMoveToPreviousDisplay @"MoveToPreviousDisplay"

#define SpectacleWindowActionMoveToNextThird @"MoveToNextThird"
#define SpectacleWindowActionMoveToPreviousThird @"MoveToPreviousThird"
Expand Down
6 changes: 2 additions & 4 deletions SpectaclePreferencesController.h
Expand Up @@ -17,10 +17,8 @@
IBOutlet ZeroKitHotKeyRecorder *myMoveToLowerLeftHotKeyRecorder;
IBOutlet ZeroKitHotKeyRecorder *myMoveToUpperRightHotKeyRecorder;
IBOutlet ZeroKitHotKeyRecorder *myMoveToLowerRightHotKeyRecorder;
IBOutlet ZeroKitHotKeyRecorder *myMoveToLeftDisplayHotKeyRecorder;
IBOutlet ZeroKitHotKeyRecorder *myMoveToRightDisplayHotKeyRecorder;
IBOutlet ZeroKitHotKeyRecorder *myMoveToTopDisplayHotKeyRecorder;
IBOutlet ZeroKitHotKeyRecorder *myMoveToBottomDisplayHotKeyRecorder;
IBOutlet ZeroKitHotKeyRecorder *myMoveToNextDisplayHotKeyRecorder;
IBOutlet ZeroKitHotKeyRecorder *myMoveToPreviousDisplayHotKeyRecorder;
IBOutlet ZeroKitHotKeyRecorder *myMoveToNextThirdHotKeyRecorder;
IBOutlet ZeroKitHotKeyRecorder *myMoveToPreviousThirdHotKeyRecorder;
IBOutlet ZeroKitHotKeyRecorder *myUndoLastMoveHotKeyRecorder;
Expand Down
34 changes: 16 additions & 18 deletions SpectaclePreferencesController.m
Expand Up @@ -34,24 +34,22 @@ - (void)windowDidLoad {
BOOL isStatusItemEnabled = [[NSUserDefaults standardUserDefaults] boolForKey: SpectacleStatusItemEnabledPreference];

myHotKeyRecorders = [[NSDictionary alloc] initWithObjectsAndKeys:
myMoveToCenterHotKeyRecorder, SpectacleWindowActionMoveToCenter,
myMoveToFullscreenHotKeyRecorder, SpectacleWindowActionMoveToFullscreen,
myMoveToLeftHotKeyRecorder, SpectacleWindowActionMoveToLeftHalf,
myMoveToRightHotKeyRecorder, SpectacleWindowActionMoveToRightHalf,
myMoveToTopHotKeyRecorder, SpectacleWindowActionMoveToTopHalf,
myMoveToBottomHotKeyRecorder, SpectacleWindowActionMoveToBottomHalf,
myMoveToUpperLeftHotKeyRecorder, SpectacleWindowActionMoveToUpperLeft,
myMoveToLowerLeftHotKeyRecorder, SpectacleWindowActionMoveToLowerLeft,
myMoveToUpperRightHotKeyRecorder, SpectacleWindowActionMoveToUpperRight,
myMoveToLowerRightHotKeyRecorder, SpectacleWindowActionMoveToLowerRight,
myMoveToLeftDisplayHotKeyRecorder, SpectacleWindowActionMoveToLeftDisplay,
myMoveToRightDisplayHotKeyRecorder, SpectacleWindowActionMoveToRightDisplay,
myMoveToTopDisplayHotKeyRecorder, SpectacleWindowActionMoveToTopDisplay,
myMoveToBottomDisplayHotKeyRecorder, SpectacleWindowActionMoveToBottomDisplay,
myMoveToNextThirdHotKeyRecorder, SpectacleWindowActionMoveToNextThird,
myMoveToPreviousThirdHotKeyRecorder, SpectacleWindowActionMoveToPreviousThird,
myUndoLastMoveHotKeyRecorder, SpectacleWindowActionUndoLastMove,
myRedoLastMoveHotKeyRecorder, SpectacleWindowActionRedoLastMove, nil];
myMoveToCenterHotKeyRecorder, SpectacleWindowActionMoveToCenter,
myMoveToFullscreenHotKeyRecorder, SpectacleWindowActionMoveToFullscreen,
myMoveToLeftHotKeyRecorder, SpectacleWindowActionMoveToLeftHalf,
myMoveToRightHotKeyRecorder, SpectacleWindowActionMoveToRightHalf,
myMoveToTopHotKeyRecorder, SpectacleWindowActionMoveToTopHalf,
myMoveToBottomHotKeyRecorder, SpectacleWindowActionMoveToBottomHalf,
myMoveToUpperLeftHotKeyRecorder, SpectacleWindowActionMoveToUpperLeft,
myMoveToLowerLeftHotKeyRecorder, SpectacleWindowActionMoveToLowerLeft,
myMoveToUpperRightHotKeyRecorder, SpectacleWindowActionMoveToUpperRight,
myMoveToLowerRightHotKeyRecorder, SpectacleWindowActionMoveToLowerRight,
myMoveToNextDisplayHotKeyRecorder, SpectacleWindowActionMoveToNextDisplay,
myMoveToPreviousDisplayHotKeyRecorder, SpectacleWindowActionMoveToPreviousDisplay,
myMoveToNextThirdHotKeyRecorder, SpectacleWindowActionMoveToNextThird,
myMoveToPreviousThirdHotKeyRecorder, SpectacleWindowActionMoveToPreviousThird,
myUndoLastMoveHotKeyRecorder, SpectacleWindowActionUndoLastMove,
myRedoLastMoveHotKeyRecorder, SpectacleWindowActionRedoLastMove, nil];

[self loadRegisteredHotKeys];

Expand Down
73 changes: 45 additions & 28 deletions SpectacleScreenDetection.m
Expand Up @@ -3,14 +3,16 @@

@interface SpectacleScreenDetection (SpectacleScreenDetectionPrivate)

+ (NSScreen *)screenAdjacentToFrameOfScreen: (CGRect)frameOfScreen inDirectionOfAction: (SpectacleWindowAction)action;

+ (NSScreen *)screenContainingRect: (CGRect)rect;

#pragma mark -

+ (CGFloat)percentageOfRect: (CGRect)rect withinFrameOfScreen: (CGRect)frameOfScreen;

#pragma mark -

+ (NSScreen *)nextOrPreviousScreenToFrameOfScreen: (CGRect)frameOfScreen inDirectionOfAction: (SpectacleWindowAction)action;

@end

#pragma mark -
Expand All @@ -20,8 +22,8 @@ @implementation SpectacleScreenDetection
+ (NSScreen *)screenWithAction: (SpectacleWindowAction)action andRect: (CGRect)rect {
NSScreen *result = [self screenContainingRect: rect];

if (MovingToDisplay(action)) {
result = [self screenAdjacentToFrameOfScreen: NSRectToCGRect([result frame]) inDirectionOfAction: action];
if (MovingToNextOrPreviousDisplay(action)) {
result = [self nextOrPreviousScreenToFrameOfScreen: NSRectToCGRect([result frame]) inDirectionOfAction: action];
}

return result;
Expand All @@ -33,30 +35,6 @@ + (NSScreen *)screenWithAction: (SpectacleWindowAction)action andRect: (CGRect)r

@implementation SpectacleScreenDetection (SpectacleScreenDetectionPrivate)

+ (NSScreen *)screenAdjacentToFrameOfScreen: (CGRect)frameOfScreen inDirectionOfAction: (SpectacleWindowAction)action {
NSScreen *result = nil;

for (NSScreen *currentScreen in [NSScreen screens]) {
CGRect currentFrameOfScreen = NSRectToCGRect([currentScreen frame]);

if (CGRectEqualToRect(currentFrameOfScreen, frameOfScreen)) {
continue;
}

if ((action == SpectacleWindowActionLeftDisplay) && RectIsLeftOfRect(currentFrameOfScreen, frameOfScreen)) {
result = currentScreen;
} else if ((action == SpectacleWindowActionRightDisplay) && RectIsRightOfRect(currentFrameOfScreen, frameOfScreen)) {
result = currentScreen;
} else if ((action == SpectacleWindowActionTopDisplay) && RectIsAboveRect(currentFrameOfScreen, frameOfScreen)) {
result = currentScreen;
} else if ((action == SpectacleWindowActionBottomDisplay) && RectIsBelowRect(currentFrameOfScreen, frameOfScreen)) {
result = currentScreen;
}
}

return result;
}

+ (NSScreen *)screenContainingRect: (CGRect)rect {
CGFloat largestPercentageOfRectWithinFrameOfScreen = 0.0f;
NSScreen *result = [NSScreen mainScreen];
Expand Down Expand Up @@ -99,4 +77,43 @@ + (CGFloat)percentageOfRect: (CGRect)rect withinFrameOfScreen: (CGRect)frameOfSc
return result;
}

#pragma mark -

+ (NSScreen *)nextOrPreviousScreenToFrameOfScreen: (CGRect)frameOfScreen inDirectionOfAction: (SpectacleWindowAction)action {
NSArray *screens = [NSScreen screens];
NSScreen *result = nil;

if ([screens count] <= 1) {
return result;
}

for (NSInteger i = 0; i < [screens count]; i++) {
NSScreen *currentScreen = [screens objectAtIndex: i];
CGRect currentFrameOfScreen = NSRectToCGRect([currentScreen frame]);
NSInteger nextOrPreviousIndex = i;

if (!CGRectEqualToRect(currentFrameOfScreen, frameOfScreen)) {
continue;
}

if (action == SpectacleWindowActionNextDisplay) {
nextOrPreviousIndex++;
} else if (action == SpectacleWindowActionPreviousDisplay) {
nextOrPreviousIndex--;
}

if (nextOrPreviousIndex < 0) {
nextOrPreviousIndex = [screens count] - 1;
} else if (nextOrPreviousIndex >= [screens count]) {
nextOrPreviousIndex = 0;
}

result = [screens objectAtIndex: nextOrPreviousIndex];

break;
}

return result;
}

@end
2 changes: 1 addition & 1 deletion SpectacleUtilities.h
Expand Up @@ -20,7 +20,7 @@

#pragma mark -

#define MovingToDisplay(action) ((action >= SpectacleWindowActionLeftDisplay) && (action <= SpectacleWindowActionBottomDisplay))
#define MovingToNextOrPreviousDisplay(action) ((action == SpectacleWindowActionNextDisplay) || (action == SpectacleWindowActionPreviousDisplay))

#pragma mark -

Expand Down
12 changes: 4 additions & 8 deletions SpectacleUtilities.m
Expand Up @@ -123,14 +123,10 @@ + (ZeroKitHotKeyAction *)actionForHotKeyWithName: (NSString *)name target: (id)t
selector = @selector(moveFrontMostWindowToUpperRight:);
} else if ([name isEqualToString: SpectacleWindowActionMoveToLowerRight]) {
selector = @selector(moveFrontMostWindowToLowerRight:);
} else if ([name isEqualToString: SpectacleWindowActionMoveToLeftDisplay]) {
selector = @selector(moveFrontMostWindowToLeftDisplay:);
} else if ([name isEqualToString: SpectacleWindowActionMoveToRightDisplay]) {
selector = @selector(moveFrontMostWindowToRightDisplay:);
} else if ([name isEqualToString: SpectacleWindowActionMoveToTopDisplay]) {
selector = @selector(moveFrontMostWindowToTopDisplay:);
} else if ([name isEqualToString: SpectacleWindowActionMoveToBottomDisplay]) {
selector = @selector(moveFrontMostWindowToBottomDisplay:);
} else if ([name isEqualToString: SpectacleWindowActionMoveToNextDisplay]) {
selector = @selector(moveFrontMostWindowToNextDisplay:);
} else if ([name isEqualToString: SpectacleWindowActionMoveToPreviousDisplay]) {
selector = @selector(moveFrontMostWindowToPreviousDisplay:);
} else if ([name isEqualToString: SpectacleWindowActionMoveToNextThird]) {
selector = @selector(moveFrontMostWindowToNextThird:);
} else if ([name isEqualToString: SpectacleWindowActionMoveToPreviousThird]) {
Expand Down
8 changes: 2 additions & 6 deletions SpectacleWindowActionController.h
Expand Up @@ -41,13 +41,9 @@

#pragma mark -

- (IBAction)moveFrontMostWindowToLeftDisplay: (id)sender;
- (IBAction)moveFrontMostWindowToNextDisplay: (id)sender;

- (IBAction)moveFrontMostWindowToRightDisplay: (id)sender;

- (IBAction)moveFrontMostWindowToTopDisplay: (id)sender;

- (IBAction)moveFrontMostWindowToBottomDisplay: (id)sender;
- (IBAction)moveFrontMostWindowToPreviousDisplay: (id)sender;

#pragma mark -

Expand Down
16 changes: 4 additions & 12 deletions SpectacleWindowActionController.m
Expand Up @@ -79,20 +79,12 @@ - (IBAction)moveFrontMostWindowToLowerRight: (id)sender {

#pragma mark -

- (IBAction)moveFrontMostWindowToLeftDisplay: (id)sender {
[myWindowPositionManager moveFrontMostWindowWithAction: SpectacleWindowActionLeftDisplay];
- (IBAction)moveFrontMostWindowToNextDisplay: (id)sender {
[myWindowPositionManager moveFrontMostWindowWithAction: SpectacleWindowActionNextDisplay];
}

- (IBAction)moveFrontMostWindowToRightDisplay: (id)sender {
[myWindowPositionManager moveFrontMostWindowWithAction: SpectacleWindowActionRightDisplay];
}

- (IBAction)moveFrontMostWindowToTopDisplay: (id)sender {
[myWindowPositionManager moveFrontMostWindowWithAction: SpectacleWindowActionTopDisplay];
}

- (IBAction)moveFrontMostWindowToBottomDisplay: (id)sender {
[myWindowPositionManager moveFrontMostWindowWithAction: SpectacleWindowActionBottomDisplay];
- (IBAction)moveFrontMostWindowToPreviousDisplay: (id)sender {
[myWindowPositionManager moveFrontMostWindowWithAction: SpectacleWindowActionPreviousDisplay];
}

#pragma mark -
Expand Down
6 changes: 2 additions & 4 deletions SpectacleWindowPositionManager.h
Expand Up @@ -15,10 +15,8 @@ typedef enum {
SpectacleWindowActionLowerRight,
SpectacleWindowActionTopHalf,
SpectacleWindowActionBottomHalf,
SpectacleWindowActionLeftDisplay,
SpectacleWindowActionRightDisplay,
SpectacleWindowActionTopDisplay,
SpectacleWindowActionBottomDisplay,
SpectacleWindowActionNextDisplay,
SpectacleWindowActionPreviousDisplay,
SpectacleWindowActionNextThird,
SpectacleWindowActionPreviousThird
} SpectacleWindowAction;
Expand Down
2 changes: 1 addition & 1 deletion SpectacleWindowPositionManager.m
Expand Up @@ -139,7 +139,7 @@ - (void)moveFrontMostWindowWithAction: (SpectacleWindowAction)action {

frontMostWindowRect.origin.y = FlipVerticalOriginOfRectInRect(frontMostWindowRect, frameOfScreen);

if (MovingToDisplay(action) && RectFitsInRect(frontMostWindowRect, visibleFrameOfScreen)) {
if (MovingToNextOrPreviousDisplay(action) && RectFitsInRect(frontMostWindowRect, visibleFrameOfScreen)) {
action = SpectacleWindowActionCenter;
}

Expand Down

0 comments on commit baf1579

Please sign in to comment.