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 2286

Summary: iOS 7. IPHONE_TOUCH_EFFICIENT_DANGEROUS is really dangerous
Product: SDL Reporter: dmuratshin <frankinshtein85>
Component: *don't know*Assignee: Sam Lantinga <slouken>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2 CC: amaranth72, icculus
Version: HG 2.1   
Hardware: ARM   
OS: iOS 6   

Description dmuratshin 2013-12-07 20:04:58 UTC
#define IPHONE_TOUCH_EFFICIENT_DANGEROUS 
should be disabled 
because at least on iOS 7 each new touch has returns new unique ID

diff -r 3e2f230a6d62 src/video/uikit/SDL_uikitview.h
--- a/src/video/uikit/SDL_uikitview.h	Sat Dec 07 11:19:52 2013 -0800
+++ b/src/video/uikit/SDL_uikitview.h	Sun Dec 08 02:04:03 2013 +0600
@@ -24,7 +24,7 @@
 
 #include "SDL_touch.h"
 
-#define IPHONE_TOUCH_EFFICIENT_DANGEROUS
+//#define IPHONE_TOUCH_EFFICIENT_DANGEROUS
 
 #ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
 #define MAX_SIMULTANEOUS_TOUCHES 5
Comment 1 Sam Lantinga 2013-12-07 21:05:31 UTC
You should get a new unique ID for each separate touch. If you're saying that a single finger down gets a different touch pointer during the lifetime of the touch that would be bad, and would make the alternate code work incorrectly.
Comment 2 dmuratshin 2013-12-07 21:22:15 UTC
exactly, even single touch has new unique ID each time and there is no way to determinate was it first or second finger
Comment 3 Alex Szpakowski 2014-07-08 00:01:34 UTC
(In reply to dmuratshin from comment #2)
> exactly, even single touch has new unique ID each time and there is no way
> to determinate was it first or second finger

The UITouch object of each touch on iOS is guaranteed to persist from touchesBegan until the same UITouch object appears in touchesEnded or touchesCancelled. SDL's current code works fine and relies on that guarantee, and Apple's multitouch event handling guide even has a code sample which makes use of the same guarantee.
Comment 4 Ryan C. Gordon 2015-02-18 21:00:03 UTC
(In reply to Alex Szpakowski from comment #3)
> The UITouch object of each touch on iOS is guaranteed to persist from
> touchesBegan until the same UITouch object appears in touchesEnded or
> touchesCancelled. SDL's current code works fine and relies on that
> guarantee, and Apple's multitouch event handling guide even has a code
> sample which makes use of the same guarantee.

So I can close this bug?

--ryan.
Comment 5 Alex Szpakowski 2015-02-18 21:12:33 UTC
I think so, yes.
Comment 6 Ryan C. Gordon 2015-02-19 16:19:59 UTC
Closing.

--ryan.