Skip to content
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

[3.x] Fix routing of InputEventScreenDrag events to Control nodes #68630

Merged

Conversation

m4gr3d
Copy link
Contributor

@m4gr3d m4gr3d commented Nov 13, 2022

Multitouch support enables multiple concurrent InputEventScreenTouch and InputEventScreenDrag events each differentiated by their index property.

An InputEventScreenDrag event typically follows another InputEventScreenDrag or InputEventScreenTouch event and thus should be routed to the target that last matched the previous touch event.
Prior to this fix, in a multitouch scenario only the target of the first touch event was tracked, causing all subsequent multitouch drag events to be routed to that invalid target. The PR tracks the touch targets using the touch event's index property, and use that data to properly route drag events based on their matching index property.

main version

@m4gr3d m4gr3d added this to the 3.6 milestone Nov 13, 2022
@m4gr3d m4gr3d requested a review from a team as a code owner November 13, 2022 23:52
@m4gr3d m4gr3d changed the title Fix routing of InputEventScreenDrag events to Control nodes [3.x] Fix routing of InputEventScreenDrag events to Control nodes Nov 13, 2022
@Calinou Calinou added the cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release label Nov 14, 2022
@m4gr3d
Copy link
Contributor Author

m4gr3d commented Nov 16, 2022

cc @Sauermann

@Sauermann
Copy link
Contributor

Alternative to #34383

@m4gr3d m4gr3d force-pushed the fix_input_event_screen_drag_routing_3x branch from 792833a to b28bcb4 Compare November 30, 2022 22:16
@m4gr3d
Copy link
Contributor Author

m4gr3d commented Nov 30, 2022

@RandomShaper Ping on this PR. It's the same as #68632 for the 3.x branch.

@akien-mga akien-mga merged commit af635f0 into godotengine:3.x Dec 1, 2022
@akien-mga
Copy link
Member

Thanks!

@timothyqiu
Copy link
Member

Cherry-picked for 3.5.2

@akien-mga
Copy link
Member

akien-mga commented Dec 22, 2022

Cherry-picked for 3.5.2

Reverted with a204af9 to fix regression #70119. We can consider cherry-picking it again if/when the regression is fixed in 3.x.

Edit: #70583 fixes the regression, so it could be cherry-picked. But let's first wait for test reports on 3.6 beta 1 before bringing this change to 3.5.

@akien-mga akien-mga added the cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release label Dec 22, 2022
@dlccmind
Copy link

I have noticed that if you have overlapping TextureButtons it is impossible to guarantee that the topmost button is the one that gets clicked. It depends on order in the tree but if you reorder them it still can affect the button below. This is maybe not a common problem, but in my case, making a jigsaw game it is a critical issue. Maybe this problem is related to this one? Just a heads up if you are looking around in this code.

@akien-mga akien-mga removed the cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release label Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants