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 4850

Summary: XInput relative motion incorrect with Wacom tablet
Product: SDL Reporter: Jay Cornwall <jay>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sezeroz
Version: 2.0.10   
Hardware: x86_64   
OS: Linux   

Description Jay Cornwall 2019-10-30 04:05:29 UTC
Relative motion in the XInput backend is implemented through XI_RawMotion events. The backend currently assumes these events report relative motion at screen scale. A Wacom tablet instead reports absolute RawMotion events at much higher DPI:

Device 11
Class 2
        Range: 0.000000 - 44704.000000
        Resolution: 200000 units/m
        Mode: absolute
        Current value: 13423.000000

To fix this we could record the mode/range and emulate screen-scale relative motion from absolute XI_RawMotion events, if the screen scale is known.

Alternatively we could emulate relative motion through the the post-scaled absolute XI_Motion event when only absolute XI_RawMotion events are available. I think this makes more sense.

I could have a go at this but wanted to check if there are good reasons to use XI_RawMotion?