FIX: inactive touch driving invalid synthetic click on state reset#2349
FIX: inactive touch driving invalid synthetic click on state reset#2349MorganHoarau wants to merge 12 commits intodevelopfrom
Conversation
Add ShouldSkipInitialStateCheck and use it in InputActionState's initial-state loop to avoid treating preserved touch data as actuated during binding re-resolution.
…om-click-on-state-reset
PR Reviewer Guide 🔍(Review updated until commit ea8b067)Here are some key observations to aid the review process:
🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr |
PR Code Suggestions ✨Explore these optional code suggestions:
🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr |
|||||||||
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## develop #2349 +/- ##
===========================================
- Coverage 77.90% 77.90% -0.01%
===========================================
Files 476 481 +5
Lines 97613 97724 +111
===========================================
+ Hits 76048 76131 +83
- Misses 21565 21593 +28 Flags with carried forward coverage won't be shown. Click here to find out more.
|
Addresses U-PR feedback Previously the code only checked the control and its immediate parent for a TouchControl, which could miss deeper nested touch controls and cause inactive touches to appear actuated during binding re-resolution. Replace the checks with a loop that walks up the control hierarchy and returns based on the first ancestor TouchControl's isInProgress value, preventing invalid triggers from preserved touch state.
…ate-reset' of https://github.com/Unity-Technologies/InputSystem into fix/uum-100125/inactive-touch-drive-phantom-click-on-state-reset
|
Persistent review updated to latest commit ea8b067 |
…om-click-on-state-reset
…om-click-on-state-reset
PR Code Suggestions ✨No code suggestions found for the PR. |
…om-click-on-state-reset
…om-click-on-state-reset
ekcoh
left a comment
There was a problem hiding this comment.
I think this fix is cleanly executed and really like that tests have been added for this specific scenario. I still wonder if a touch-specific solution is really needed, but see no reason to not land this now. We can always revisit this together with later interaction robustness improvements if needed since all is internal. Good job on sorting this out @MorganHoarau!
Description
Addresses UUM-100125 (phantom click after device rotation).
Follow up PR about a UITKInputModule failing test locally: #2367
Issue:
InputActionStateto run initial-state catch-up inOnBeforeInitialUpdate. (See Comments To Reviewers section for overview)positionisdontReset = true). So the stale state (touch position being non-default) was treated as fresh actuation and trigger unexpected callbacks.Changes
Actions_InitialStateCheckAfterConfigurationChange_DoesNotTriggerForInactiveTouchActions_WithMultipleCompositeBindings_WithoutEvaluateMagnitude_Works(true)to align the new expected behaviour. The test still preserves the original ISXB-98 guarantee: after enabling, real subsequent touches must still trigger the composite action correctly.TODO:
Testing status & QA
Actions_WithMultipleCompositeBindings_WithoutEvaluateMagnitude_Works(true)Overall Product Risks
Comments to reviewers
Tracing the whole flow can help understand the broader context.
DeviceConfigurationEventflow diagram:flowchart TD subgraph Native["Native / Backend"] A[Device rotates] B[Queue DeviceConfigurationEvent] end subgraph IM["InputManager"] C[Process DeviceConfigurationEvent] D[NotifyConfigurationChanged] E[InputActionState.OnDeviceChange ConfigurationChanged] end subgraph IASResolve["InputActionState.Resolve phase"] F[Full binding re-resolve] G[Set initialStateCheckPending = true] end subgraph IASInitial["InputActionState.OnBeforeInitialUpdate"] H[Loop bindings and controls] I{Control belongs to TouchControl?} J{touch.isInProgress?} K[Default CheckStateIsAtDefault path] end subgraph OldPath["Old behavior"] L[SignalStateChangeMonitor for inactive touch] M[Started/Performed from stale touch state] N[Phantom UI click] end subgraph NewPath["Current proposed fix"] O[Skip inactive touch control] P[No synthetic Started/Performed] Q[No phantom UI click] end A --> B B --> C C --> D D --> E E --> F F --> G G --> H H --> I I -- no --> K I -- yes --> J J -- yes --> K J -- no old --> L L --> M M --> N J -- no new --> O O --> P P --> QChecklist
Before review:
Changed,Fixed,Addedsections.Area_CanDoX,Area_CanDoX_EvenIfYIsTheCase,Area_WhenIDoX_AndYHappens_ThisIsTheResult.During merge:
NEW: ___.FIX: ___.DOCS: ___.CHANGE: ___.RELEASE: 1.1.0-preview.3.