tap should default to disabled, not enabled
authorSam Lantinga <slouken@libsdl.org>
Sat, 26 Nov 2016 10:26:26 -0800
changeset 10654a9713e5c7788
parent 10653 f87d76304c76
child 10655 a303ec46889b
tap should default to disabled, not enabled
src/video/cocoa/SDL_cocoamousetap.m
     1.1 --- a/src/video/cocoa/SDL_cocoamousetap.m	Sat Nov 26 10:26:22 2016 -0800
     1.2 +++ b/src/video/cocoa/SDL_cocoamousetap.m	Sat Nov 26 10:26:26 2016 -0800
     1.3 @@ -203,6 +203,8 @@
     1.4                                          kCGEventTapOptionDefault, allGrabbedEventsMask,
     1.5                                          &Cocoa_MouseTapCallback, tapdata);
     1.6          if (tapdata->tap) {
     1.7 +            /* Tap starts disabled, until app requests mouse grab */
     1.8 +            CGEventTapEnable(tapdata->tap, false);
     1.9              tapdata->thread = SDL_CreateThreadInternal(&Cocoa_MouseTapThread, "Event Tap Loop", 512 * 1024, tapdata);
    1.10              if (tapdata->thread) {
    1.11                  /* Success - early out. Ownership transferred to thread. */
    1.12 @@ -222,7 +224,7 @@
    1.13      SDL_MouseEventTapData *tapdata = (SDL_MouseEventTapData*)driverdata->tapdata;
    1.14      if (tapdata && tapdata->tap)
    1.15      {
    1.16 -        CGEventTapEnable(tapdata->tap, enabled);
    1.17 +        CGEventTapEnable(tapdata->tap, !!enabled);
    1.18      }
    1.19  }
    1.20