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 1784

Summary: Windows touch IDs are possibly wrong
Product: SDL Reporter: Ryan C. Gordon <icculus>
Component: eventsAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 Keywords: target-2.0.0
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   

Description Ryan C. Gordon 2013-04-03 12:06:51 UTC
This line in src/video/windows/SDL_windowsevents.c ...

    const SDL_TouchID touchId = (SDL_TouchID)input->hSource;

...triggers a compiler warning, because hSource is a HANDLE (which is a void* we're casting to Sint64 here), but the bigger problem is MSDN's documentation on this field:

   http://msdn.microsoft.com/en-us/library/windows/desktop/dd317334(v=vs.85).aspx

"hSource
A device handle for the source input device. Each device is given a unique provider at run time by the touch input provider."

I assume this is eventually a handle to the touch screen device, or a touchpad or whatever, and not unique to the specific touch.

We probably want the "dwID" field instead, which is a DWORD (safer to cast to an SDL_TouchID), and corresponds to the finger:

"dwID
A touch point identifier that distinguishes a particular touch input. This value stays consistent in a touch contact sequence from the point a contact comes down until it comes back up. An ID may be reused later for subsequent contacts."

I'm leaving this as a bug to look at later instead of fixing it, though, since I haven't familiarized myself with this code to know if any of this is correct.

--ryan.
Comment 1 Ryan C. Gordon 2013-07-12 22:15:39 UTC
(Sorry if you get a lot of copies of this email, we're touching dozens of bug reports right now.)

Tagging a bunch of bugs as target-2.0.0, Priority 2.

This means we're in the final stretch for an official SDL 2.0.0 release! These are the bugs we really want to fix before shipping if humanly possible.

That being said, we don't promise to fix them because of this tag, we just want to make sure we don't forget to deal with them before we bless a final 2.0.0 release, and generally be organized about what we're aiming to ship.

Hopefully you'll hear more about this bug soon. If you have more information (including "this got fixed at some point, nevermind"), we would love to have you come add more information to the bug report when you have a moment.

Thanks!
--ryan.
Comment 2 Ryan C. Gordon 2013-07-30 00:18:33 UTC
> I'm leaving this as a bug to look at later instead of fixing it, though,
> since I haven't familiarized myself with this code to know if any of this is
> correct.

Turns out this is correct; SDL_TouchID corresponds to the touch device, not the finger.

The compiler warning is fixed in http://hg.libsdl.org/SDL/rev/a96f309059a1 ...

--ryan.