FIX: Suppress touch simulation while the Device Simulator is open [UUM-153420] - #2484
Conversation
…M-151404] Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Looks worse than it sounds, it's a small corner case improvement for testing and is not a blocker. |
Pauliusd01
left a comment
There was a problem hiding this comment.
Did a quick recheck on 6000.0.74f1, lgtm
|
Approving but the P1 findings sounds/looks real to me, I would suggest fixing that separately across versions then. |
Codecov ReportAttention: Patch coverage is @@ Coverage Diff @@
## develop #2484 +/- ##
========================================
Coverage 78.95% 78.96%
========================================
Files 767 767
Lines 140914 140989 +75
========================================
+ Hits 111262 111333 +71
- Misses 29652 29656 +4 Flags with carried forward coverage won't be shown. Click here to find out more.
|
…ader so PVP-40-1 passes Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…gelog header so PVP-40-1 passes" This reverts commit c714cec.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
I'm forcing landing this. The failure that currently exists is also on |
Description
Backport of trunk PR unity/unity#123402.
Problem
A single mouse click in the Device Simulator produces two active touches when "Simulate Touch Input From Mouse or Pen" is enabled in the Input Debugger.
EnhancedTouch.Touch.activeTouchesreports two entries with different touch IDs, in different coordinate spaces, both at finger index 0:Fixes UUM-151404 which was reported through LinkedIn, and we could not exactly reproduce what the user mention in the specific versions. 1.19 actually didn't reproduce this bug because it was obfuscated by another bug fixed in 1.20.
Cause
Two
Touchscreendevices are live at once and each produces a touch per click:"Device Simulator Touchscreen", added byInputSystemPlugin, fed fromDeviceSimulator.touchScreenInput."Simulated Touchscreen", added byTouchSimulation, fed fromMouse/Penevents.Nothing has ever prevented these two from coexisting, so they are in fact producing separate events.
Solution
Pragmatic fix:
TouchSimulationnow skips event processing while a Device Simulator view is open, so the Device Simulator's touchscreen is the only source of "simulated touches". The Input Debugger's toggle is shown as unavailable while a simulator is open, since it would otherwise appear to work while having no effect.This means Device Simulator in fact takes over "Touch Simulation".
Testing status & QA
Test suite was run locally on 6000.0 at least.
Overall Product Risks
Comments to reviewers
Code is the same as the trunk PR.
Checklist
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.