diff --git a/js/components/main.js b/js/components/main.js index 57c19dd7e6f..78822957e88 100644 --- a/js/components/main.js +++ b/js/components/main.js @@ -214,7 +214,7 @@ class Main extends ImmutableComponent { registerSwipeListener () { // Navigates back/forward on macOS two- and or three-finger swipe - let swipeGesture = false + let mouseInFrame = false let trackingFingers = false let startTime = 0 let isSwipeOnLeftEdge = false @@ -223,17 +223,10 @@ class Main extends ImmutableComponent { let deltaY = 0 let time - ipc.on(messages.ENABLE_SWIPE_GESTURE, (e) => { - swipeGesture = true - }) - - ipc.on(messages.DISABLE_SWIPE_GESTURE, (e) => { - swipeGesture = false - }) - // isSwipeTrackingFromScrollEventsEnabled is only true if "two finger scroll to swipe" is enabled ipc.on('scroll-touch-begin', () => { - if (swipeGesture) { + mouseInFrame = this.props.windowState.getIn(['ui', 'mouseInFrame']) + if (mouseInFrame) { trackingFingers = true startTime = (new Date()).getTime() } @@ -278,7 +271,7 @@ class Main extends ImmutableComponent { }) const throttledSwipe = _.throttle(direction => { - if (swipeGesture) { + if (mouseInFrame) { if (direction === 'left') { ipc.emit(messages.SHORTCUT_ACTIVE_FRAME_BACK) } else if (direction === 'right') {