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

Wayland: send normalized coordinates in touch inputs events #4362

Merged

Conversation

HenkKalkwater
Copy link
Contributor

On wayland systems, this will send x,y coordinates in SDL_TouchFingerEvent normalised to [0..1] instead of window coordinates.

Description

According to https://wiki.libsdl.org/SDL_TouchFingerEvent, the SDL_TouchFingerEvent, the x,y coordinates should be normalised to [0..1]. This wasn't the case on wayland clients. Therefore, this merge request fixes that.

Games and applications using SDL, running with a wayland compositor and working around this issue will break on touch input if this gets merged. I haven't accounted for that within this merge request, I don't know if I should and I don't know how I should. Suggestions are welcome.

Tested on SailfishOS running the Lipstick wayland compositor. Could anyone verify this on other wayland compositors with touch input?

Existing Issue(s)

Resolves #4361

Copy link
Collaborator

@flibitijibibo flibitijibibo left a comment

Choose a reason for hiding this comment

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

The Wayland backend was pretty experimental up until this next release, so apps using it now will probably be happy that a workaround isn't required anymore.

@slouken slouken merged commit 889cebb into libsdl-org:main May 5, 2021
@dos1
Copy link
Contributor

dos1 commented Aug 8, 2021

I know I'm a bit late, but just for the reference:

Could anyone verify this on other wayland compositors with touch input?

FWIW this doesn't even apply to most compositors, since the changed code is part of a Qt-specific protocol extension, which I believe is only used by Sailfish (and maybe Ubuntu Touch?) these days.

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.

Touch input events x,y coordinates are not normalized on wayland
4 participants