Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Feat/enable threefinger swipe, closes #3299 #7786

Merged
merged 1 commit into from
Apr 5, 2017

Conversation

lucidNTR
Copy link
Contributor

@lucidNTR lucidNTR commented Mar 19, 2017

closes #3299

Test Plan:

On macOS:
- set system settings > trackpad > more gestures > swipe between pages to "OFF"
- start brave > open any website > click a few links
- try swiping with two or three fingers > nothing should happen

- quit brave > change same setting to "ON" and "swipe with two fingers"
- start brave > open any website > click a few links
- try swiping with two or three fingers > only two finger 'overscrolling' of horizontal scroll should trigger navigation

- quit brave > change same setting to "ON" and "swipe with three fingers"
- start brave > open any website > click a few links
- try swiping with two or three fingers > swiping with three fingers  horizontally should trigger navigation

- quit brave > change same setting to "ON" and "swipe with three or two fingers"
- start brave > open any website > click a few links
- try swiping with two or three fingers > swiping with three fingers  horizontally should trigger navigation or overscrolling with two fingers should trigger the navigation

@lucidNTR
Copy link
Contributor Author

unsure why standard fails on travis but not locally, will fix soon, but of course PR feedback is welcome asap.

@lucidNTR
Copy link
Contributor Author

@luixxiul the standard errors on travis are from code i did not even touch, is travis configured correctly?

/home/travis/build/brave/browser-laptop/app/renderer/components/clipboardButton.js:40:1: Expected indentation of 8 space characters but found 0.
/home/travis/build/brave/browser-laptop/app/renderer/components/preferences/payment/bitcoinDashboard.js:210:1: Expected indentation of 12 space characters but found 0.
/home/travis/build/brave/browser-laptop/app/renderer/components/preferences/payment/disabledContent.js:32:1: Expected indentation of 10 space characters but found 0.
/home/travis/build/brave/browser-laptop/app/renderer/components/preferences/payment/disabledContent.js:33:1: Expected indentation of 10 space characters but found 0.
/home/travis/build/brave/browser-laptop/app/renderer/components/preferences/payment/ledgerTable.js:110:11: Expected indentation of 4 space characters but found 10.

@NejcZdovc
Copy link
Contributor

@lucidNTR #7794, there is already a fix ready for this problem

@luixxiul
Copy link
Contributor

@lucidNTR The travis error issue is known to the team and they are working on it lately. You do not have to be too worried on the issue. Please run test locally and if it is fine, then it is ok.

@cndouglas
Copy link

ecd391c fixed two finger swipe and swipe disabled. #7905 is now tracking three finger swipe. Maybe we can integrate this to implement three finger swipe.

@cndouglas
Copy link

Tagged as work in progress since ecd391c has caused some conflicts.

@lucidNTR lucidNTR force-pushed the feat/enable_threefinger_swipe branch from 3c06699 to 1d5138a Compare March 29, 2017 13:50
@lucidNTR
Copy link
Contributor Author

@liunkae i rebased my pr and also fixed a new issue where the system setting 'two AND three fingers' was not respected

@cndouglas
Copy link

@lucidNTR Great! I'll review in a little while.

Copy link

@cndouglas cndouglas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found one problem: the two finger swipe also works when only the three finger swipe is enabled.
Repro steps:

  1. Set the preference to "Swipe with three fingers" (see screenshot)
    image
  2. Try to swipe left or right with two fingers.
  3. The page navigates (but it should not).

Otherwise, looks good!

@lucidNTR
Copy link
Contributor Author

lucidNTR commented Mar 30, 2017

@liunkae are you sure you restarted brave between changing the settings? I looked at the code and i cannot find a way to explain the wrong behaviour you described. :-/ Maybe you just closed the window, not full quit?

@cndouglas
Copy link

cndouglas commented Mar 30, 2017

In one of my tests, I did not restart. Restarting seemed to fix the problem. Besides requiring a restart, the behavior now matches Firefox.

In my opinion, we probably should either make a note somewhere that it requires a restart or find a way to not require a restart.

@lucidNTR
Copy link
Contributor Author

lucidNTR commented Mar 30, 2017 via email

@cndouglas
Copy link

cndouglas commented Mar 30, 2017

Good points. Regardless, this PR is a step in the right direction.

@bsclifton
Copy link
Member

@darkdh is this one you could also review? 😄

@darkdh
Copy link
Member

darkdh commented Apr 3, 2017

Np

@darkdh darkdh self-requested a review April 3, 2017 14:48
Copy link
Member

@darkdh darkdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job @lucidNTR.


// isSwipeTrackingFromScrollEventsEnabled is only true if "two finger scroll to swipe" is enabled
// the swipe gesture handler will only fire if the three finger swipe setting is on, so the complete off setting and three and two finger together is also taken care of
if (systemPreferences.isSwipeTrackingFromScrollEventsEnabled()) {
Copy link
Member

@darkdh darkdh Apr 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you put this check in scroll-touch-begin? Because we don't want user to restart for every system setting change. Other browsers do not require restart and we should have the same behavior.

@darkdh
Copy link
Member

darkdh commented Apr 3, 2017

Please squash all the commits after you make the change, thanks.

@lucidNTR lucidNTR force-pushed the feat/enable_threefinger_swipe branch from 1d5138a to 6546acc Compare April 5, 2017 01:41
@lucidNTR
Copy link
Contributor Author

lucidNTR commented Apr 5, 2017

@darkdh Ok i tried my best to keep the impact as minimal as possible, yet check on touchstart. Let me know if there is still issues, but my feeling is this is mergeable now...
Only issue is that there are non standard.js changes in master now and i could not commit without disabling checks, though i made sure my changes pass, any idea how this could have happened? probably someone has an outdated standard, we should hard pin the standard version used in the pre commit hook

@lucidNTR
Copy link
Contributor Author

lucidNTR commented Apr 5, 2017

argh i committed my yarn file. is this ok? i strongly think yarn is far supperiour and we should have this anyways, ok or should i remove?

@luixxiul
Copy link
Contributor

luixxiul commented Apr 5, 2017

The PR which added yarn support was reverted once here: #6437 (comment)

I don't think any progress is done so I think you should remove the file from this PR.

@darkdh
Copy link
Member

darkdh commented Apr 5, 2017

What @luixxiul said. Please remove it thanks.

@lucidNTR lucidNTR force-pushed the feat/enable_threefinger_swipe branch from 6546acc to f217ff9 Compare April 5, 2017 08:43
@lucidNTR
Copy link
Contributor Author

lucidNTR commented Apr 5, 2017

@darkdh ok removed, will look into that again at later point

Copy link
Member

@darkdh darkdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

�lgtm now thanks

@niclasek
Copy link

niclasek commented Sep 8, 2017

Hi, I experience this bug with Brave version 0.18.29 on macOS 10.12.6
Expected result: as above
Actual result:

  • When setting 'swipe between pages' to 'swipe with three fingers' navigation does not trigger on swipe with three fingers (neither with two)
  • When setting 'swipe between pages' to 'swipe with two or three fingers' navigation triggers on swipe with three fingers but not on swipe with two fingers.

I have restarted brave after changing the setting.

@cndouglas
Copy link

@niclasek We have an issue for that: #9845

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fixed back/forward gesture to match system preferences
7 participants