Skip to content

Commit

Permalink
tap should default to disabled, not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Nov 26, 2016
1 parent 354a8f2 commit 25f54f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/video/cocoa/SDL_cocoamousetap.m
Expand Up @@ -203,6 +203,8 @@
kCGEventTapOptionDefault, allGrabbedEventsMask,
&Cocoa_MouseTapCallback, tapdata);
if (tapdata->tap) {
/* Tap starts disabled, until app requests mouse grab */
CGEventTapEnable(tapdata->tap, false);
tapdata->thread = SDL_CreateThreadInternal(&Cocoa_MouseTapThread, "Event Tap Loop", 512 * 1024, tapdata);
if (tapdata->thread) {
/* Success - early out. Ownership transferred to thread. */
Expand All @@ -222,7 +224,7 @@
SDL_MouseEventTapData *tapdata = (SDL_MouseEventTapData*)driverdata->tapdata;
if (tapdata && tapdata->tap)
{
CGEventTapEnable(tapdata->tap, enabled);
CGEventTapEnable(tapdata->tap, !!enabled);
}
}

Expand Down

0 comments on commit 25f54f0

Please sign in to comment.