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 1781

Summary: SDL sets an error for the initial touch on Android.
Product: SDL Reporter: Philipp Wiesemann <philipp.wiesemann>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: All   
OS: Android (All)   
Attachments: patch for SDL setting error for initial touch on Android

Description Philipp Wiesemann 2013-04-01 07:51:17 UTC
Created attachment 1095 [details]
patch for SDL setting error for initial touch on Android

SDL sets an error to be queried with SDL_GetError() for the initial touch on Android.

Android_OnTouch() in SDL_androidtouch.c uses SDL_GetTouch() to check if a touch device was already added. SDL_GetTouch() sets the error "Unknown touch device" for an out of range access because touch devices are added after initial touch. I think this error is confusing because it always happens by design.

I attached a patch which removes the call to SDL_GetTouch() and only uses SDL_AddTouch() which does the check (if already added) again and does not set an error (if not added yet).
Comment 1 Sam Lantinga 2013-04-02 10:52:11 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/fb7b426ab660