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 - Mac: SDL_FINGERUP events don't always trigger (touch presses get "stuck")
Summary: Mac: SDL_FINGERUP events don't always trigger (touch presses get "stuck")
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.1
Hardware: x86_64 Mac OS X (All)
: P2 normal
Assignee: (disabled) Jørgen Tjernø
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-14 22:21 UTC by Alex Szpakowski
Modified: 2014-01-15 01:36 UTC (History)
1 user (show)

See Also:


Attachments
Patch to fix Cocoa code for cancelled touches (757 bytes, patch)
2014-01-14 22:21 UTC, Alex Szpakowski
Details | Diff

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