-
Notifications
You must be signed in to change notification settings - Fork 6k
Fix unexpected pointer change issue and Add test case #43949
Conversation
This pull request was opened against a branch other than main. Since Flutter pull requests should not normally be opened against branches other than main, I have changed the base to main. If this was intended, you may modify the base back to master. See the Release Process for information about how other branches get updated. Reviewers: Use caution before merging pull requests to branches other than main, unless this is an intentional hotfix/cherrypick. |
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My question -- what happens to the data in the ACTION_SCROLL here? Is it important we should turn that into an actual scroll update? Or it's OK just to throw it away and ignore this event? Looks like your change now will just ignore it, the new event (PAN_ZOOM_UPDATE) will (should?) have fields of zero-- being a no-op.
shell/platform/android/io/flutter/embedding/android/AndroidTouchProcessor.java
Outdated
Show resolved
Hide resolved
shell/platform/android/io/flutter/embedding/android/AndroidTouchProcessor.java
Outdated
Show resolved
Hide resolved
shell/platform/android/io/flutter/embedding/android/AndroidTouchProcessor.java
Outdated
Show resolved
Hide resolved
Map scroll event for PointerChange.HOVER and finaly PointerChange.PAN_ZOOM_UPDATE. just as your advise before. @@ -396,12 +411,12 @@ public class AndroidTouchProcessor {
|
fcbf66f
to
f0f00ec
Compare
@moffatman Any update or comment? |
.verify(mockRenderer) | ||
.dispatchPointerDataPacket(packetCaptor.capture(), packetSizeCaptor.capture()); | ||
packet = packetCaptor.getValue(); | ||
assertEquals(0.0, readPointerPhysicalX(packet)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you test, what are the deviceKind, signalKind, and pointerChange here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
shell/platform/android/io/flutter/embedding/android/AndroidTouchProcessor.java
Show resolved
Hide resolved
Does the ACTION_SCROLL generic motion event contain any useful data? Such as some scroll delta which isn't in any other event? Maybe it's best just to skip this event altogether. Follow same approach as I would like to see, if you can print out the exact events and field values from the real device? Thanks :) Also, you will have to use the formatting script I think to get all the checks to pass. |
For events in that wired device, please refer to flutter/flutter#129765. Copy them here: 06-29 19:19:42.562 4919 4919 V AndroidTouchProcessor: onGenericMotionEvent, event MotionEvent { action=ACTION_HOVER_ENTER, actionButton=0, id[0]=0, x[0]=1296.2535, y[0]=398.5768, toolType[0]=TOOL_TYPE_MOUSE, buttonState= drop this ACTION_SCROLL is not a good choice I think . |
Already done. That Linux linux_unopt case is not related to this patch, and I don't known how to fix it. |
Yes, it is related to your patch, see the mismatch in formatting here: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8774350301251168225/+/u/test:_test:format_and_dart_test__3_/stdout |
Looking at the log above, there is no useful info in the ACTION_SCROLL. All fields zero. What happens afterwards? Is there ACTION_UP on this "scroll pointer"? |
Done. |
Sorry, I don't have that device any more. Drop that event or send that event to flutter, it's a question... |
OK. I propose we can just drop the event. At the beginning of |
Done. |
Btw, I think you have to rebase to fix the test failure |
Done. |
I just tried running locally, you don't need the changes for testing, you can add |
Signed-off-by: Xiaohu Hu <huxiaohu2007@gmail.com>
Yes,you are right. I have changed the code . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for all the changes 👍
cc @reidbaker for second approval. |
Any update ? |
Sorry I wasn't actually added as a reviewer and I triage pings slower than review requests. I don't see anything obviously wrong but I am going to defer to @Piinks. I am not as comfortable as I should be with the scroll logic. Thank you for your contribution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @LoveJello welcome, thanks for contributing! I see you found and reported the issue as well, many thanks . :)
LGTM!
…132332) flutter/engine@a9be77e...16b01b9 2023-08-10 skia-flutter-autoroll@skia.org Roll Dart SDK from 46da53e7abe2 to a2eac00da6b8 (1 revision) (flutter/engine#44601) 2023-08-10 huxiaohu2007@gmail.com Fix unexpected pointer change issue and Add test case (flutter/engine#43949) 2023-08-10 47866232+chunhtai@users.noreply.github.com Reland "Android a11y bridge sets importantness" (flutter/engine#44589) 2023-08-10 john@johnmccutchan.com Support for Android Platform Views under Impeller/Vulkan (flutter/engine#44571) 2023-08-10 109111084+yaakovschectman@users.noreply.github.com Reintroduce Windows lifecycle with guard for posthumous `OnWindowStateEvent` (flutter/engine#44344) 2023-08-10 skia-flutter-autoroll@skia.org Roll Skia from 92e6f52b0fa8 to b6492f5ce8c3 (1 revision) (flutter/engine#44597) 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 chinmaygarde@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose 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/+doc/main/autoroll/README.md
Fix issue 129765 and Add test case, see issue Fixes flutter/flutter#129765 - [�] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [�] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [�] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [�] I listed at least one issue that this PR fixes in the description above. - [�] I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See [testing the engine] for instructions on writing and running engine tests. - [�] I updated/added relevant documentation (doc comments with `///`). - [�] I signed the [CLA]. - [ �] All existing and new tests are passing. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Fix issue 129765 and Add test case, see issue
Fixes flutter/flutter#129765
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.