-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Call CaptureLost on gestures when pointer loses capture #12666
Conversation
92ae557
to
caaee5f
Compare
cool. This should also unblock #12558 now. |
You can test this PR using the following package version. |
@@ -61,6 +62,7 @@ protected override void PointerPressed(PointerPressedEventArgs e) | |||
{ | |||
if (Target != null && Target is Visual visual && (e.Pointer.Type == PointerType.Touch || e.Pointer.Type == PointerType.Pen)) | |||
{ | |||
Debug.WriteLine($"Pointer with ID: {e.Pointer.Id} pressed"); |
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.
Debug code @emmauss
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.
Removed
You can test this PR using the following package version. |
c0cd98c
to
f81b454
Compare
You can test this PR using the following package version. |
Call CaptureLost on gestures when pointer loses capture
What does the pull request do?
Ensures that the pointer capture lost event is called on all gesture recognizers attached to an input element.
What is the current behavior?
All gestures receive the PointerPressed event, and they set states to start tracking the pointer. If PointerMoveD is received and the conditions for the gesture is met, the gesture captures the pointer, and no other gesture receives events. When the pointer is released, all gestures receive the Released events and reset their states.
In the case of Touch, if the device sends a TouchCancel event, it's interpreted as a CaptureLost event. Only the captured InputElement and the CapturedGesture handles this. For other gestures on the input element that have received the PointerPressed event and set their initial state, they don't receive any event to reset it. This is also true when none of the gestures have captured the pointer
What is the updated/expected behavior with this PR?
When an input element loses pointer capture, all gesture recognizers attached to it that was not the source of the CaptureLost gets
notified. When the pointer loses capture or is cancelled, all gesture recognizers of the last caputed element will be notified.
How was the solution implemented (if it's not obvious)?
Checklist
Breaking changes
Obsoletions / Deprecations
Fixed issues
Fixes #12083