-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add embedderId to PointerEvent
#60930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add embedderId to PointerEvent
#60930
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
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.
Is this a unique ID for each PointerEvent or can multiple PointerEvents have the same motionEventId?
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.
Nope, this is unique per PointerEvent. Multiple PointerEvents can not have the same motionEventId.
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 we document this in a more platform-independent way so we can re-use this for the other platforms as well?
Exact wording would depend on the answer to the question below. Does this id uniquely identify the event across framework and engine? Or (if there are multiple PointerEvent with this id) does it identify the native event that generated this framework-side PointerEvent uniquely on the engine side? Something like this should be included in the doc comment.
After that, we can also include a platform-specific paragraph that on android this maps to the ID of the underlying MotionEvent. Or something like that.
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 will try to address this and the comment below here:
What do you think of embedderPointerEventIdentifier as a possible name for this? Given that this is different from pointerIdentifier -- which is used for hit testing, whereas embedderPointerEventIdentifier is used to tie back the current pointer event to the platform equivalent which resulted in this event.
If you agree with that, I can elaborate the dart-doc to explain the intent of this field along with the differences between this and pointerIdentifier.
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 we just shorten this to embedderId?
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.
The doc should still include the explanation how it is different from the other IDs in this class.
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.
SG
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.
A name for this property that doesn't tie it to Android's MotionEvents (and hence can be reused for other platforms) would probably also be a good idea.
This change makes it so that we track all the motion events encountered by `FlutterView` and all of its subviews in the `MotionEventTracker` class, indexed by a unique `MotionEventId`. This identifier is then passed to the Flutter framework as seen in flutter/flutter#60930. Once the gestures take part in gesture disambiguation and are sent back to the engine, we look-up the original motion event using the `MotionEventId` and dispatch it to the platform. Bug: flutter/flutter#58837
338c4c2 to
fc290a2
Compare
embedderId to PointerEvent
|
@goderbauer I plan on landing this change as part of a manual engine roll during off-peak hours. The engine commit that this change relies on is at: flutter/engine#19484. |
goderbauer
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.
LGTM
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.
... to the embedder event that created it?
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.
Maybe add a section about Android explaining that on Android this is the ID of the underlying MotionEvent.
This change makes it so that we track all the motion events encountered by `FlutterView` and all of its subviews in the `MotionEventTracker` class, indexed by a unique `MotionEventId`. This identifier is then passed to the Flutter framework as seen in flutter/flutter#60930. Once the gestures take part in gesture disambiguation and are sent back to the engine, we look-up the original motion event using the `MotionEventId` and dispatch it to the platform. Bug: flutter/flutter#58837
fc290a2 to
4cb3686
Compare
blasten
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.
LGTM
This change makes it so that we track all the motion events encountered by `FlutterView` and all of its subviews in the `MotionEventTracker` class, indexed by a unique `MotionEventId`. This identifier is then passed to the Flutter framework as seen in flutter/flutter#60930. Once the gestures take part in gesture disambiguation and are sent back to the engine, we look-up the original motion event using the `MotionEventId` and dispatch it to the platform. Bug: flutter/flutter#58837
5dffc18 to
ab9c057
Compare
|
This pull request is not suitable for automatic merging in its current state.
|
446d655 to
32fc8c5
Compare
This field is used to look-up the event in the platform that resuted a given `PointerEvent`. This is currently only used on Android, where the `embedderId` is set to be the `motionEventId` for a given `MotionEvent`.
7a90f12 to
ee59f09
Compare
|
This pull request is not suitable for automatic merging in its current state.
|
This reverts commit 2ab5099.
This reverts commit 2ab5099.
) This change makes it so that we track all the motion events encountered by `FlutterView` and all of its subviews in the `MotionEventTracker` class, indexed by a unique `MotionEventId`. This identifier is then passed to the Flutter framework as seen in flutter/flutter#60930. Once the gestures take part in gesture disambiguation and are sent back to the engine, we look-up the original motion event using the `MotionEventId` and dispatch it to the platform. Bug: flutter/flutter#58837
This field is used to look-up the event in the platform that resuted a given `PointerEvent`. This is currently only used on Android, where the `embedderId` is set to be the `motionEventId` for a given `MotionEvent`. Roll engine to d0d6a4c
This field is used to look-up the event in the platform that resuted a given
PointerEvent. This is currently only used on Android, where theembedderIdis set to be themotionEventIdfor a givenMotionEvent.Related Issues
#58837
Tests
@blasten and I will work on testing strategy for this change as follow-up PRs.
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.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read [Handling breaking changes].