Skip to content

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

Merged
merged 23 commits into from
Oct 2, 2024

Conversation

adrian-koretski-unity3d
Copy link
Collaborator

@adrian-koretski-unity3d adrian-koretski-unity3d commented Aug 13, 2024

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:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

After merge:

  • Create forward/backward port if needed. If you are blocked from creating a forward port now please add a task to ISX-1444.

@unity-cla-assistant
Copy link

unity-cla-assistant commented Aug 13, 2024

CLA assistant check
All committers have signed the CLA.

@@ -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()
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Copy link
Collaborator

@ekcoh ekcoh left a 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.

@ekcoh
Copy link
Collaborator

ekcoh commented Sep 5, 2024

@adrian-koretski-unity3d Seems like it needs resolved conflict and CI rerun to get into green state before QA pass

@ekcoh ekcoh requested a review from Pauliusd01 September 5, 2024 09:48
Copy link
Collaborator

@ekcoh ekcoh left a 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.

Copy link
Collaborator

@ekcoh ekcoh left a 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

Copy link
Collaborator

@ekcoh ekcoh left a 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?

Copy link
Collaborator

@ekcoh ekcoh left a 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

@Pauliusd01
Copy link
Collaborator

Will check this today

Copy link
Collaborator

@Pauliusd01 Pauliusd01 left a 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

@adrian-koretski-unity3d adrian-koretski-unity3d merged commit ff7837e into develop Oct 2, 2024
77 checks passed
@adrian-koretski-unity3d adrian-koretski-unity3d deleted the isxb-543-fix-touch-double-remove branch October 2, 2024 17:59
jfreire-unity added a commit that referenced this pull request Jul 7, 2025
jfreire-unity added a commit that referenced this pull request Jul 11, 2025
jfreire-unity added a commit that referenced this pull request Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants