Mac and Linux SDL2 binary snapshots
Edward Rudd
2014-03-08 e2b6e957100030b4c9e8d720157b0a34195e6dcb
source/src/video/cocoa/SDL_cocoamousetap.m
@@ -1,6 +1,6 @@
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
@@ -18,7 +18,7 @@
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/
#include "SDL_config.h"
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_COCOA
@@ -60,9 +60,10 @@
static CGEventRef
Cocoa_MouseTapCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon)
{
    SDL_MouseData *driverdata = (SDL_MouseData*)refcon;
    SDL_MouseEventTapData *tapdata = (SDL_MouseEventTapData*)refcon;
    SDL_Mouse *mouse = SDL_GetMouse();
    SDL_Window *window = SDL_GetKeyboardFocus();
    NSWindow *nswindow;
    NSRect windowRect;
    CGPoint eventLocation;
@@ -71,7 +72,7 @@
        case kCGEventTapDisabledByTimeout:
        case kCGEventTapDisabledByUserInput:
            {
                CGEventTapEnable(((SDL_MouseEventTapData*)(driverdata->tapdata))->tap, true);
                CGEventTapEnable(tapdata->tap, true);
                return NULL;
            }
        default:
@@ -92,8 +93,9 @@
    }
    /* This is the same coordinate system as Cocoa uses. */
    nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
    eventLocation = CGEventGetUnflippedLocation(event);
    windowRect = [((SDL_WindowData *) window->driverdata)->nswindow frame];
    windowRect = [nswindow contentRectForFrameRect:[nswindow frame]];
    if (!NSPointInRect(NSPointFromCGPoint(eventLocation), windowRect)) {