When the mouse is grabbed it's constrained to the client area, not the window frame.
authorSam Lantinga <slouken@libsdl.org>
Sat, 16 Nov 2013 21:19:16 -0800
changeset 8005d8edfca6e3c2
parent 8004 13da154af020
child 8006 a906369d3f8e
When the mouse is grabbed it's constrained to the client area, not the window frame.
src/video/cocoa/SDL_cocoamousetap.m
     1.1 --- a/src/video/cocoa/SDL_cocoamousetap.m	Sat Nov 16 18:56:02 2013 -0800
     1.2 +++ b/src/video/cocoa/SDL_cocoamousetap.m	Sat Nov 16 21:19:16 2013 -0800
     1.3 @@ -63,6 +63,7 @@
     1.4      SDL_MouseEventTapData *tapdata = (SDL_MouseEventTapData*)refcon;
     1.5      SDL_Mouse *mouse = SDL_GetMouse();
     1.6      SDL_Window *window = SDL_GetKeyboardFocus();
     1.7 +    NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
     1.8      NSRect windowRect;
     1.9      CGPoint eventLocation;
    1.10  
    1.11 @@ -93,7 +94,7 @@
    1.12  
    1.13      /* This is the same coordinate system as Cocoa uses. */
    1.14      eventLocation = CGEventGetUnflippedLocation(event);
    1.15 -    windowRect = [((SDL_WindowData *) window->driverdata)->nswindow frame];
    1.16 +    windowRect = [nswindow contentRectForFrameRect:[nswindow frame]];
    1.17  
    1.18      if (!NSPointInRect(NSPointFromCGPoint(eventLocation), windowRect)) {
    1.19