From 0db84025d9c7bddb678f29b86a75877af935712f Mon Sep 17 00:00:00 2001 From: Dmitry Obukhov Date: Thu, 6 Oct 2016 16:06:51 +0200 Subject: [PATCH] fix cells dragging on Sierra --- RealmTasks Apple/RealmTasks macOS/TaskCellView.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/RealmTasks Apple/RealmTasks macOS/TaskCellView.swift b/RealmTasks Apple/RealmTasks macOS/TaskCellView.swift index ade83fc..eb318e9 100644 --- a/RealmTasks Apple/RealmTasks macOS/TaskCellView.swift +++ b/RealmTasks Apple/RealmTasks macOS/TaskCellView.swift @@ -229,17 +229,13 @@ extension TaskCellView: TaskTextFieldDelegate { extension TaskCellView: NSGestureRecognizerDelegate { func gestureRecognizerShouldBegin(gestureRecognizer: NSGestureRecognizer) -> Bool { - guard gestureRecognizer is NSPanGestureRecognizer else { - return false - } - let currentlyEditingTextField = ((window?.firstResponder as? NSText)?.delegate as? NSTextField) - guard let event = NSApp.currentEvent where currentlyEditingTextField != textView else { + guard currentlyEditingTextField != textView else { return false } - return fabs(event.deltaX) > fabs(event.deltaY) + return true } // FIXME: This could easily be refactored to avoid such a high CC.