Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Mac: don't ignore mouse clicks on the top pixel of a window (thanks, …
…Joshua!).

Fixes Bugzilla #3190.
  • Loading branch information
icculus committed Dec 29, 2015
1 parent 61518bc commit 326b357
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/video/cocoa/SDL_cocoawindow.m
Expand Up @@ -823,7 +823,14 @@ - (void)mouseDown:(NSEvent *)theEvent

/* Ignore events that aren't inside the client area (i.e. title bar.) */
if ([theEvent window]) {
const NSRect windowRect = [[[theEvent window] contentView] frame];
NSRect windowRect = [[[theEvent window] contentView] frame];

/* add one to size, since NSPointInRect is exclusive of the bottom
edges, which mean it misses the top of the window by one pixel
(as the origin is the bottom left). */
windowRect.size.width += 1;
windowRect.size.height += 1;

if (!NSPointInRect([theEvent locationInWindow], windowRect)) {
return;
}
Expand Down

0 comments on commit 326b357

Please sign in to comment.