Switch to a single OS X swipe event with a direction argument

This commit is contained in:
James Wheare 2016-03-23 15:20:11 +00:00
parent 03319a5426
commit 8482109dea
7 changed files with 21 additions and 64 deletions

View file

@ -268,15 +268,15 @@ bool ScopedDisableResize::disable_resize_ = false;
// NSWindow overrides.
- (void)swipeWithEvent:(NSEvent *)event {
if (event.deltaY == 1.0) {
shell_->NotifyWindowSwipeUp();
} else if (event.deltaX == -1.0) {
shell_->NotifyWindowSwipeRight();
} else if (event.deltaY == -1.0) {
shell_->NotifyWindowSwipeDown();
} else if (event.deltaX == 1.0) {
shell_->NotifyWindowSwipeLeft();
}
if (event.deltaY == 1.0) {
shell_->NotifyWindowSwipe("up");
} else if (event.deltaX == -1.0) {
shell_->NotifyWindowSwipe("right");
} else if (event.deltaY == -1.0) {
shell_->NotifyWindowSwipe("down");
} else if (event.deltaX == 1.0) {
shell_->NotifyWindowSwipe("left");
}
}
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen*)screen {