Skip to content
This repository has been archived by the owner. It is now read-only.

Apply two fingers swiper changes to 901d5dba082a5e5d5213d726337a532b95b269d6 #8642

Merged
merged 1 commit into from May 6, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Apply two fingers swiper changes to

901d5db

fix #8627

Auditors: @bbondy, @bridiver

Test Plan:
1. Search something on google.com
2. Click one of the search result
3. Try to navigate back to previous results page by two fingers swiping
  • Loading branch information
darkdh committed May 3, 2017
commit 6debdd7d164d493eb1d27af6aa49187a9ce36bfb
@@ -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') {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.