-
Notifications
You must be signed in to change notification settings - Fork 6k
[ios][platform_view]force reset forwarding recognizer state when its stuck #55958
[ios][platform_view]force reset forwarding recognizer state when its stuck #55958
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
|
Tested the demo app from github issue and confirmed it's working. I will do more testing before landing it. |
5076c8e to
97c628b
Compare
97c628b to
40e6eaa
Compare
jmagman
left a comment
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.
I don't know if change would impact it, but can you confirm the totally-not-running-anywhere iPad gesture tests still pass?
https://github.com/flutter/engine/blob/4e6405e2a89fa8fda2c0e7017ddcd8b39d7b3052/testing/scenario_app/ios/Scenarios/ScenariosUITests/iPadGestureTests.m
| return self; | ||
| } | ||
|
|
||
| - (ForwardingGestureRecognizer*)recreateRecognizerWithTarget:(id)target { |
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.
Would it be possible for ForwardingGestureRecognizer to instead implement NSCopying?
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.
Talked to @hellohuanlin, this isn't feasible because of the move which makes the old recognizer unusable.
|
|
||
| - (void)forceResetForwardingGestureRecognizerState { | ||
| // When iPad pencil is involved in a finger touch gesture, the gesture is not reset to "possible" | ||
| // state, which causes subsequent touches to be blocked. As a workaround, we force reset the state |
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.
and is stuck on "failed"
|
Verified both google map and web view plugin example apps still work as expected. |
|
@tdevaux confirmed this fixes the issue |
I got all of them failed with main branch on simulator. Let me try physical devices. |
Don't worry about it, we can investigate later and get them passing and running somewhere. |
|
I was able to run on device and got the same failure as simulator. Filed flutter/flutter#157454 |
|
auto label is removed for flutter/engine/55958, due to - The status or check suite Mac mac_unopt has failed. Please fix the issues identified (or deflake) before re-applying this label. |
flutter/engine@73c54fa...5d7caf7 2024-10-23 34871572+gmackall@users.noreply.github.com Delete v1 android engine embedding (flutter/engine#52022) 2024-10-23 41930132+hellohuanlin@users.noreply.github.com [ios][platform_view]force reset forwarding recognizer state when its stuck (flutter/engine#55958) 2024-10-23 jason-simmons@users.noreply.github.com Allow running the YAPF formatter using Python version 3.11 (flutter/engine#56062) 2024-10-23 jonahwilliams@google.com [Impeller] optimize clip rects by checking if integral coverage is sufficient. (flutter/engine#56041) 2024-10-23 a-siva@users.noreply.github.com Switch the web compilation step to use an AOT snapshot (flutter/engine#56040) 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 codefu@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://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…7478) flutter/engine@73c54fa...5d7caf7 2024-10-23 34871572+gmackall@users.noreply.github.com Delete v1 android engine embedding (flutter/engine#52022) 2024-10-23 41930132+hellohuanlin@users.noreply.github.com [ios][platform_view]force reset forwarding recognizer state when its stuck (flutter/engine#55958) 2024-10-23 jason-simmons@users.noreply.github.com Allow running the YAPF formatter using Python version 3.11 (flutter/engine#56062) 2024-10-23 jonahwilliams@google.com [Impeller] optimize clip rects by checking if integral coverage is sufficient. (flutter/engine#56041) 2024-10-23 a-siva@users.noreply.github.com Switch the web compilation step to use an AOT snapshot (flutter/engine#56040) 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 codefu@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://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…stuck (flutter/engine#55958) This PR force reset forwarding recognizer state when it's stuck at failed state, by recreating the recognizer (we are not able to reset the state back to possible - it has to be reset by UIKit). This is a tricky one since pencil and finger triggers exactly the same callbacks. It turns out that when pencil is involved after finger interaction, the platform view's "forwarding" gesture recognizer is stuck at failed state. This seems to be an iOS bug, because according to [the API doc](https://developer.apple.com/documentation/uikit/uigesturerecognizerstate/uigesturerecognizerstatefailed?language=objc), it should be reset back to "possible" state: > No action message is sent and the gesture recognizer is reset to [UIGestureRecognizerStatePossible](https://developer.apple.com/documentation/uikit/uigesturerecognizerstate/uigesturerecognizerstatepossible?language=objc). However, when iPad pencil is involved, the state is not reset. I tried to KVO the state property, and wasn't able to capture the change. This means the state change very likely happened internally within the recognizer via the backing ivar of the state property. Fixes flutter#136244 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This PR force reset forwarding recognizer state when it's stuck at failed state, by recreating the recognizer (we are not able to reset the state back to possible - it has to be reset by UIKit).
This is a tricky one since pencil and finger triggers exactly the same callbacks. It turns out that when pencil is involved after finger interaction, the platform view's "forwarding" gesture recognizer is stuck at failed state. This seems to be an iOS bug, because according to the API doc, it should be reset back to "possible" state:
However, when iPad pencil is involved, the state is not reset. I tried to KVO the state property, and wasn't able to capture the change. This means the state change very likely happened internally within the recognizer via the backing ivar of the state property.
Fixes flutter/flutter#136244
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.