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

Motion events emulation & multitouch gestures for touch events broken as of 2.0.22 on certain devices (X11) #5652

Closed
mil opened this issue May 11, 2022 · 13 comments
Assignees
Milestone

Comments

@mil
Copy link

mil commented May 11, 2022

As of upgrading to 2.0.22 on certain devices on X11, the emulation of motion events for touch devices is broken. Specifically I'm testing on the Pinephone on X11. What I've observed is that SDL_MOUSEBUTTONUP and SDL_MOUSEBUTTONDOWN are properly reported, however SDL_MOUSEMOTION events are not reported. Additionally gesture events (SDL_MULTIGESTURE) are not reported. Downgrading to 2.0.20 fixes these issues and SDL_MULTIGESTURE and SDL_MOUSEMOTION are then properly reported.

I've also noticed that setting the hint SDL_TOUCH_MOUSE_EVENTS to 0 restores the functionality of SDL_MULTIGESTURE events (but doesn't effect motion events..).

If I had to guess the root cause of this issue is: 8f8b14c .. however I haven't tested beyond just downgrading to 2.0.20 and seeing things work.

I'm testing on X11/Alpine Linux edge (postmarketOS) on a Pinephone (aarch64). Two example applications packaged to test with are mepo and rue which both use touch events (and you can observe differences in application functionality between 2.0.22 and 2.0.20).

@mil
Copy link
Author

mil commented May 11, 2022

koreader/koreader#9091
^ found this issue in researching as well, may be related

@slouken slouken added this to the 2.0.24 milestone May 11, 2022
@slouken
Copy link
Collaborator

slouken commented May 11, 2022

Can you check that commit and see if that's the problem? It doesn't look like that would have the effect you're describing, offhand.

@mil
Copy link
Author

mil commented May 11, 2022

Hmm, so I tested reverting both: 8f8b14c and 96be9cd neither are the issue.

Not entirely sure on the root cause / where to investigate to determine cause of this issue. 2.0.20 is working as expected for me. Was there some rework to touch/motion events from 2.0.20 -> 2.0.22 that could be the cause.

@slouken
Copy link
Collaborator

slouken commented May 11, 2022

Can you use git bisect to identify the breaking change?

@mil
Copy link
Author

mil commented May 11, 2022

Offending commit is: 5ff4243

Setting export SDL_MOUSE_AUTO_CAPTURE=0 fixes things on 2.0.22 for me; maybe auto capture should be disabled by default

@slouken
Copy link
Collaborator

slouken commented May 11, 2022

Why does auto capture affect touch events?

@sezero
Copy link
Contributor

sezero commented May 11, 2022

That commit caused way too many issues

@dos1
Copy link
Contributor

dos1 commented Jul 21, 2022

Touch handling on X11 with auto capture enabled is broken in general, it's not just gestures or mouse emulation. SDL sends an FINGERUP event right after FINGERDOWN (sometimes there's a single FINGERMOTION in between in you move your finger fast), so the touches end as soon as they start.

@slouken
Copy link
Collaborator

slouken commented Jul 21, 2022

@icculus, can you look into this?

@ell1e
Copy link
Contributor

ell1e commented Jul 21, 2022

For what it's worth, here is a reproduction case for the single touch mouse motion emulation (with SDL_MOUSE_TOUCHID) that has some visualization: #5924 (comment) Doesn't cover multi touch however.

@icculus
Copy link
Collaborator

icculus commented Jul 22, 2022

Yeah, I'll take a look.

@slouken
Copy link
Collaborator

slouken commented Aug 11, 2022

I can reproduce this here, I'm investigating.

@slouken slouken assigned slouken and unassigned icculus and mil Aug 11, 2022
@slouken
Copy link
Collaborator

slouken commented Aug 11, 2022

Fixed, thanks!

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

No branches or pull requests

6 participants