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 2348

Summary: Mac: SDL_FINGERUP events don't always trigger (touch presses get "stuck")
Product: SDL Reporter: Alex Szpakowski <amaranth72>
Component: eventsAssignee: (disabled) Jørgen Tjernø <jorgen>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: jorgen
Version: HG 2.1   
Hardware: x86_64   
OS: Mac OS X (All)   
Attachments: Patch to fix Cocoa code for cancelled touches

Description Alex Szpakowski 2014-01-14 22:21:11 UTC
Created attachment 1521 [details]
Patch to fix Cocoa code for cancelled touches

In Mac OS X (10.9.1) when using my trackpad, touch finger presses are recognized correctly but sometimes SDL_FINGERUP isn't triggered when I remove my finger. This results in a buildup of "active" fingers (according to SDL).

This seems to happen when my trackpad finger movements are recognized as a global gesture by OS X (e.g. when I swipe several fingers up for exposé actions), and when I have fingers pressed on the trackpad when switching away from the SDL program with command-tab.

I believe I found a bug in SDL's Cocoa code which causes the latter case: Cocoa's NSTouchPhaseCancelled touch events aren't handled properly by SDL.

I've attached a patch which fixes that code and seems to fix the case where SDL_FINGERUP events aren't triggered properly when switching away from the SDL application, but it doesn't fix the case where SDL_FINGERUP events aren't triggered after doing a global OS X gesture with the SDL application active.
Comment 1 (disabled) Jørgen Tjernø 2014-01-15 01:35:56 UTC
Thanks, applied your patch in http://hg.libsdl.org/SDL/rev/4e3e41b2cbfb