OSX: Capture 3-finger swipe events in NativeWindow

This commit is contained in:
James Wheare 2016-03-18 15:20:04 +00:00
parent 67db92d500
commit 03319a5426
7 changed files with 76 additions and 0 deletions

View file

@ -267,6 +267,18 @@ 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();
}
}
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen*)screen {
// Resizing is disabled.
if (ScopedDisableResize::IsResizeDisabled())