Skip to content

Conversation

@dkwingsmt
Copy link
Contributor

@dkwingsmt dkwingsmt commented Apr 30, 2019

Description

This PR is a reland of #30339.

Changes compared with the previous attempt: (See here for diff)

  • If a pointer data contains PointerDeviceKind.unknown, PointerEventConverter will synthesize its buttons using the following rule: if buttons = 0, return kPrimaryButton; otherwise return unchanged.
  • Changed TestPointer to a better API. Its buttons can no longer be set; instead set it using the new optional parameter in methods down and move.

Explanation

The previous attempt broke some device labs and the desktop embedder. Through investigation, it's likely because adb shell input as well as the desktop embedder send events that have device kind unknown and buttons 0, which was not synthesized with kPrimaryButton. To fix this, this PR synthesizes kPrimaryButton for PointerDeviceKind.unknown.

All red device labs have been manually tested on real Android devices.

Related Issues

Tests

I added the following tests:

  • PointerEventConverter should synthesize events from unknown.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read Handling breaking changes). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

@dkwingsmt dkwingsmt requested a review from gspencergoog April 30, 2019 01:14
@goderbauer goderbauer added a: desktop Running on desktop framework flutter/packages/flutter repository. See also f: labels. labels Apr 30, 2019
@dkwingsmt dkwingsmt merged commit fea2c7d into flutter:master Apr 30, 2019
@dkwingsmt dkwingsmt deleted the redo-tap-buttons branch April 30, 2019 16:56
jonahwilliams pushed a commit that referenced this pull request May 1, 2019
jonahwilliams pushed a commit that referenced this pull request May 1, 2019
dkwingsmt added a commit to dkwingsmt/flutter that referenced this pull request May 1, 2019
@dkwingsmt dkwingsmt mentioned this pull request May 1, 2019
9 tasks
dkwingsmt added a commit that referenced this pull request May 20, 2019
* Revert "Revert "Redo: Add buttons to gestures (#31819)" (#31912)"

This reverts commit 60a1b2b.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: desktop Running on desktop framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants