Browse Source
* Fix pointer capture cancellation on Win32 A cancelled pen or mouse interaction was reported as an ordinary leave, and nothing released the capture that came with it, so the captured element never saw PointerCaptureLost. Win32 constants: POINTER_FLAG_CONFIDENCE and POINTER_FLAG_CANCELED were declared an order of magnitude too small - the SDK defines them as 0x4000 and 0x8000 - so the cancellation check in GetEventType could never match. Ctrl+Alt+Del or Win+L mid stroke therefore arrived as a normal button up, and the app committed an interaction the user had aborted. Win32 handling: WM_POINTERCAPTURECHANGED and POINTER_FLAG_CANCELED now map to CancelCapture for non touch pointers, matching what the legacy WM_CAPTURECHANGED path has always done. PenDevice: handle CancelCapture by releasing the capture while keeping the pointer alive, since the pen is still in range and a leave arrives separately. Pointer hardening: CaptureLost ends every capture the pointer holds, on the element and on a gesture recognizer, and the devices release through it instead of repeating the steps. Capturing to a recognizer clears Captured, so the null check in the platform path used to skip the whole release while a scroll, pull or swipe gesture owned the pointer, and a touch up never cleared the recognizer at all. Dispose releases as well rather than leaving that to every caller, a disposed pointer ignores further capture calls and asserts when a capturer is passed, and devices drop a pointer from their map before disposing it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Keep the explicit capture source in MouseTestHelper The helper captures through Pointer.Capture(target), which is an explicit capture, and used to release with Capture(null) - explicit as well. Releasing as implicit changed the source that capture changing handlers observe. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>pull/22069/head
committed by
GitHub
8 changed files with 75 additions and 29 deletions
Loading…
Reference in new issue