Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes Skia touch/pen selection for SelectorBarItem (and ItemsView-based selection) by avoiding re-entrancy that clears the pointer-over state during OnPointerReleased. This aligns the touch/pen path with the previously-fixed mouse path and adds a runtime test to prevent regressions.
Changes:
- Snapshot
m_pointerInfo.IsPointerOver()beforeReleasePointerCapture()so the invoke gate is evaluated against the pre-release state. - Add a new runtime test validating
SelectorBarItemselection via injected touch tap.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Uno.UI/UI/Xaml/Controls/ItemContainer/ItemContainer.cs | Fixes pointer capture release re-entrancy by snapshotting pointer-over state before releasing capture. |
| src/Uno.UI.RuntimeTests/MUX/Microsoft_UI_Xaml_Controls/SelectorBar/SelectorBarTests.cs | Adds a touch-injection runtime test to ensure SelectorBarItem selection works for touch taps on Skia. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23877/wasm-skia-net9/index.html |
|
Tick the box to add this pull request to the merge queue (same as
|
|
@Mergifyio backport release/stable/6.6 |
✅ Backports have been createdDetails
|
…6.6/pr-23877 fix(itemcontainer): snapshot isOver before capture release (backport #23877)
GitHub Issue: closes #23876
PR Type:
🐞 Bugfix
What changed? 🚀
Tapping a
SelectorBarItem(or anyItemsView-based selection) with touch or pen does nothing on Skia targets, while mouse clicks work. #23208 fixed the mouse path only.ItemContainer.OnPointerReleasedcallsReleasePointerCapturebefore evaluating the item-invoke gate. On managed pointers that release synchronously raisesPointerCaptureLost→ProcessPointerCanceled, which resets the touch/pen pointer-over state — so the gate'sIsPointerOver()check fails andItemInvoked(PointerReleased)(the only triggerItemsViewselects on;Tapis a selection no-op) is never raised.This PR snapshots the pointer-over state before releasing the capture and uses the snapshot in the invoke gate. This fixes the re-entrancy at its source for all pointer device types, while keeping WinUI's genuine-cancel semantics (a real cancellation, e.g. a scroll stealing the pointer, still resets the touch/pen over-state and its visual state).
Validation (Skia Desktop macOS, Release):
SelectorBarTests.VerifySelectorBarItemBecomesSelectedAfterTouchTap(touch-injection twin of the fix(selectorbar): adjust tracking of isOver mouse state #23208 mouse test): fails before the fix, passes after.SelectorBarTests6/6 passed (including the mouse test and the release-outside-bounds visual-state guard — no regression).ItemsViewTests10/10 passed.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_014Cwnh87BjMzYGmCtEcVYhf