-
Notifications
You must be signed in to change notification settings - Fork 327
FIX: ISXB-687 Added guard clause to RemovePointerAtIndex in InputSy… #1982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX: ISXB-687 Added guard clause to RemovePointerAtIndex in InputSy… #1982
Conversation
…emUIInputModule to not remove touch pointers on the same frame they are released.
@@ -1897,6 +1897,13 @@ private void RemovePointerAtIndex(int index) | |||
{ | |||
Debug.Assert(m_PointerStates[index].eventData.pointerEnter == null, "Pointer should have exited all objects before being removed"); | |||
|
|||
// We don't want to release touch pointers on the same frame they are released. They get cleaned up one frame later in Process() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reasoning in the comment makes sense to me, however I wonder why the below conditions are needed, it sounds like it would be more of a general fix that pointers (that may only exist during contact) shouldn't be removed mid frame for any scenario?
I looked through the file but failed to spot where the clean-up/removal happens when this condition triggers, do you have a reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the cleanup I'm referring to happens on line 2222 in the same file (InputSystemUIInputModule) in the Process() function call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this test UITests.UI_CanDriveUIFromMultiplePointers(SingleMouseOrPenButMultiTouchAndTrack) is not passing? Needs to be fixed to get green CI on this one, or first rerun to see it was not something wrong with the environment.
@adrian-koretski-unity3d Seems like it needs resolved conflict and CI rerun to get into green state before QA pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like failing tests and conflicts needs some work.
…orce their release on the same frame they occur. Ran the formatter and applied changes to CHANGELOG.md
…/Unity-Technologies/InputSystem into isxb-543-fix-touch-double-remove
…certain pointers to be incorrectly released or not released.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to remove hinge entry from CHANGELOG since its a duplicate
…System into isxb-543-fix-touch-double-remove # Conflicts: # Packages/com.unity.inputsystem/CHANGELOG.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CHANGELOG still seems off?
…/Unity-Technologies/InputSystem into isxb-543-fix-touch-double-remove
…System into isxb-543-fix-touch-double-remove
…System into isxb-543-fix-touch-double-remove
Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs
Outdated
Show resolved
Hide resolved
…nputSystemUIInputModule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CHANGELOG.md looks good now, thank you @adrian-koretski-unity3d
Will check this today |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tested the user project normally as well as rebinding the UI controls to something other than the mouse
Description
When we disable a behaviour, the touch pointer no longer gets removed twice.
Changes made
Added code to prevent the first removal of the touch pointer (since we want to defer it to the following frame).
Testing
Manual testing
Risk
Low risk
Checklist
Before review:
Changed
,Fixed
,Added
sections.Area_CanDoX
,Area_CanDoX_EvenIfYIsTheCase
,Area_WhenIDoX_AndYHappens_ThisIsTheResult
.During merge:
NEW: ___
.FIX: ___
.DOCS: ___
.CHANGE: ___
.RELEASE: 1.1.0-preview.3
.After merge: