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 - SDL sets an error for the initial touch on Android.
Summary: SDL sets an error for the initial touch on Android.
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: All Android (All)
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-01 07:51 UTC by Philipp Wiesemann
Modified: 2013-04-02 10:52 UTC (History)
0 users

See Also:


Attachments
patch for SDL setting error for initial touch on Android (648 bytes, patch)
2013-04-01 07:51 UTC, Philipp Wiesemann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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