diff --git a/js/components/main.js b/js/components/main.js index c85429ebe52..9d146f136e8 100644 --- a/js/components/main.js +++ b/js/components/main.js @@ -133,6 +133,7 @@ class Main extends ImmutableComponent { var swipeGesture = false var canSwipeBack = false var canSwipeForward = false + var isSwipeOnEdge = false var deltaX = 0 var deltaY = 0 var startTime = 0 @@ -192,14 +193,15 @@ class Main extends ImmutableComponent { if (swipeGesture && systemPreferences.isSwipeTrackingFromScrollEventsEnabled()) { trackingFingers = true + isSwipeOnEdge = false startTime = (new Date()).getTime() } }) ipc.on('scroll-touch-end', function () { - if (time > 50 && trackingFingers && Math.abs(deltaY) < 50) { - if (deltaX > 100 && canSwipeForward) { + if (time > 50 && trackingFingers && Math.abs(deltaY) < 50 && isSwipeOnEdge) { + if (deltaX > 70 && canSwipeForward) { ipc.emit(messages.SHORTCUT_ACTIVE_FRAME_FORWARD) - } else if (deltaX < -100 && canSwipeBack) { + } else if (deltaX < -70 && canSwipeBack) { ipc.emit(messages.SHORTCUT_ACTIVE_FRAME_BACK) } } @@ -210,6 +212,9 @@ class Main extends ImmutableComponent { deltaY = 0 startTime = 0 }) + ipc.on('scroll-touch-edge', function () { + isSwipeOnEdge = true + }) ipc.on(messages.LEAVE_FULL_SCREEN, this.exitFullScreen.bind(this)) } diff --git a/js/stores/appStore.js b/js/stores/appStore.js index 3a9fd395b0e..96495ea52ec 100644 --- a/js/stores/appStore.js +++ b/js/stores/appStore.js @@ -178,6 +178,10 @@ const createWindow = (browserOpts, defaults, frameOpts, windowState) => { mainWindow.webContents.send('scroll-touch-end') }) + mainWindow.on('scroll-touch-edge', function (e) { + mainWindow.webContents.send('scroll-touch-edge') + }) + mainWindow.on('enter-full-screen', function () { if (mainWindow.isMenuBarVisible()) { mainWindow.setMenuBarVisibility(false)