Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Fix touchpad scrolling on Chromebook #11420

Merged
dkwingsmt merged 1 commit intoflutter:masterfrom
dkwingsmt:fix-chromebook-trackpad-scroll
Aug 26, 2019
Merged

Fix touchpad scrolling on Chromebook #11420
dkwingsmt merged 1 commit intoflutter:masterfrom
dkwingsmt:fix-chromebook-trackpad-scroll

Conversation

@dkwingsmt
Copy link
Contributor

@dkwingsmt dkwingsmt commented Aug 23, 2019

On a Chromebook, if the user scrolls using two fingers on the trackpad, ARC translates it into a mouse down-move-up event sequence with buttons: 0, which is no longer acceptable by DragGestureRecognizer.

This temporary fix patches these events by setting buttons to 1, the primary button. This is by no means perfect, besides being ugly, because it can trigger unintended drags that are not scrolling. However it is at least as good as what it used to be (before DragGestureRecognizer stop accepting 0-button events).

The correct way is to implement trackpad gestures (as in this issue), but it is a much bigger job. See flutter/flutter#23604

Related issues

Fixes flutter/flutter#36118

Tests

This change fix does not include tests, because it's very hard to emulate these irregular events and test the behavior of widgets.

To manually test it, run the example in flutter/flutter#36118 on a Chromebook and see if the list can be scrolled using trackpad.

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM. Please add a reference to the fixed bug in the description though.

@dkwingsmt dkwingsmt merged commit ba1a303 into flutter:master Aug 26, 2019
@dkwingsmt dkwingsmt deleted the fix-chromebook-trackpad-scroll branch August 26, 2019 18:50
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 26, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Aug 26, 2019
[email protected]:flutter/engine.git/compare/11e3ade157db...ba1a303

git log 11e3ade..ba1a303 --no-merges --oneline
2019-08-26 [email protected] Patch buttons for chromebook touchpad (flutter/engine#11420)
2019-08-26 [email protected] Skip empty platform view overlays. (flutter/engine#11427)


If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
@stuartmorgan-g
Copy link
Contributor

The issue has been closed in flutter (#11420), but the fix hasn't made it into stable yet.

The bug system tracks the state of master, not stable, so that is expected.

@wreppun
Copy link

wreppun commented Sep 3, 2019

Whoops, sorry, that comment was intended for an internal ticket! Thanks for the fix on this!

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.

Touchpad scroll on chromebooks doesn't work on stable (1.7.8+hotfix.2)

4 participants