We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4183

Summary: [patch] Incorrect touch normalization using X11 XInput2
Product: SDL Reporter: Zack Middleton (zturtleman) <zack>
Component: eventsAssignee: Ryan C. Gordon <icculus>
Status: ASSIGNED --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus, sezeroz
Version: HG 2.0   
Hardware: ARM   
OS: Linux   
Attachments: Normalize x11xinput2 touch x to be 1.0 at width

Description Zack Middleton (zturtleman) 2018-05-31 20:55:10 UTC
Created attachment 3253 [details]
Normalize x11xinput2 touch x to be 1.0 at width

Applications (such as SDL's testgesture) do "event.tfinger.x * window_width" to find window coord. Currently the X11 XInput2 backend expects application to do "event.tfinger.x * (window_width-1)" instead.

X11 XInput2 touch events are normalized so x is 1.0 at "width - 1" but other SDL backends appear to have x be 1.0 at "width". Same issue for touch event y with regards to height.

Related to bug #3871.
Comment 1 Ryan C. Gordon 2018-06-25 05:49:35 UTC
This patch is now https://hg.libsdl.org/SDL/rev/dfebed374d73, thanks!

--ryan.
Comment 2 Sam Lantinga 2018-06-26 22:50:53 UTC
This is wrong, the other backends should be fixed. Mouse coordinates are 0 based, so at (width,height) they are outside the window.
Comment 3 Ryan C. Gordon 2018-07-02 17:21:06 UTC
I'll back this out for now, then. Sorry!

--ryan.
Comment 4 Ryan C. Gordon 2018-08-03 21:23:10 UTC
This was backed out in https://hg.libsdl.org/SDL/rev/317db3d3712c ; leaving this assigned to me for now.

--ryan.