Skip to content
Permalink
Browse files

tap should default to disabled, not enabled

  • Loading branch information
slouken committed Nov 26, 2016
1 parent 354a8f2 commit 25f54f0f4f015ab74117ca9438d24005b1179260
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/video/cocoa/SDL_cocoamousetap.m
@@ -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. */
@@ -222,7 +224,7 @@
SDL_MouseEventTapData *tapdata = (SDL_MouseEventTapData*)driverdata->tapdata;
if (tapdata && tapdata->tap)
{
CGEventTapEnable(tapdata->tap, enabled);
CGEventTapEnable(tapdata->tap, !!enabled);
}
}

0 comments on commit 25f54f0

Please sign in to comment.