Skip to content

Commit

Permalink
When the mouse is grabbed it's constrained to the client area, not th…
Browse files Browse the repository at this point in the history
…e window frame.
  • Loading branch information
slouken committed Nov 17, 2013
1 parent e414626 commit 9dd923f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/video/cocoa/SDL_cocoamousetap.m
Expand Up @@ -63,6 +63,7 @@
SDL_MouseEventTapData *tapdata = (SDL_MouseEventTapData*)refcon;
SDL_Mouse *mouse = SDL_GetMouse();
SDL_Window *window = SDL_GetKeyboardFocus();
NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
NSRect windowRect;
CGPoint eventLocation;

Expand Down Expand Up @@ -93,7 +94,7 @@

/* This is the same coordinate system as Cocoa uses. */
eventLocation = CGEventGetUnflippedLocation(event);
windowRect = [((SDL_WindowData *) window->driverdata)->nswindow frame];
windowRect = [nswindow contentRectForFrameRect:[nswindow frame]];

if (!NSPointInRect(NSPointFromCGPoint(eventLocation), windowRect)) {

Expand Down

0 comments on commit 9dd923f

Please sign in to comment.