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 6 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 🔍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 476
Lines 97613 97648 +35
===========================================
+ Hits 76048 76072 +24
- Misses 21565 21576 +11 Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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
Description
Fixes UUM-100125 (phantom click after device rotation) by looking at the hardware phase (
TouchPhase.Began/Moved/Stationary- which is exactly whatTouchControl.isInProgressexposes) and preventing initial state check when the touch is actually ended.This should be the correct semantic fixed according to the documentation:
Root cause
TouchControlis unusual as it intentionally preserves position state after the touch ends, socontrol.CheckStateIsAtDefault()returns false even for a long-dead touch. No other common control type behaves this way.Issue:
InputActionStateto run initial-state catch-up inOnBeforeInitialUpdate. (See Comments To Reviewers section for overview)positionisdontReset = true).Changes
Actions_InitialStateCheckAfterConfigurationChange_DoesNotTriggerForInactiveTouchActions_WithMultipleCompositeBindings_WithoutEvaluateMagnitude_Works(true)to align with new expected behaviour.TODO:
UI_CanOperateUIToolkitInterface_UsingInputSystemUIInputModuleis failingTesting 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.