Skip to content

Commit

Permalink
Attempt to handle thirds in a bit more loosely.
Browse files Browse the repository at this point in the history
  • Loading branch information
eczarny committed Apr 17, 2015
1 parent c72665c commit 50831e5
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Spectacle/SpectacleWindowPositionManager.m
Expand Up @@ -242,14 +242,6 @@ - (void)moveWindowRect: (CGRect)windowRect frameOfScreen: (CGRect)frameOfScreen
[self moveWindowRect: windowRect frontMostWindowElement: frontMostWindowElement];

CGRect movedWindowRect = [self rectOfWindowWithAccessibilityElement: frontMostWindowElement];

if (MovingToThirdOfDisplay(action) && !RectCenteredWithinRect(movedWindowRect, windowRect)) {
NSBeep();

[self moveWindowRect: previousWindowRect frontMostWindowElement: frontMostWindowElement];

return;
}

if ((action != SpectacleWindowActionUndo) && (action != SpectacleWindowActionRedo)) {
[self moveWindowRect:windowRect frontMostWindowElement: frontMostWindowElement];
Expand Down Expand Up @@ -292,6 +284,12 @@ - (void)moveWindowRect: (CGRect)windowRect frameOfScreen: (CGRect)frameOfScreen
[self moveWindowRect: adjustedWindowRect frontMostWindowElement: frontMostWindowElement];
}
}

if (MovingToThirdOfDisplay(action) && !CGRectContainsRect(windowRect, movedWindowRect)) {
NSBeep();

[self moveWindowRect: previousWindowRect frontMostWindowElement: frontMostWindowElement];
}
}

- (void)moveWindowRect: (CGRect)windowRect frontMostWindowElement: (ZKAccessibilityElement *)frontMostWindowElement {
Expand Down

0 comments on commit 50831e5

Please sign in to comment.