Skip to content

Commit

Permalink
Cocoa: ignore mouseDown events in a window's titlebar.
Browse files Browse the repository at this point in the history
These events accidentally slipping in sometimes appears to be a bug (or
maybe new behavior) in 10.10, as previous versions of Mac OS X don't appear
to ever trigger this.

Thanks to Paulo Marques for pointing out the fix on the SDL mailing list!

Fixes Bugzilla #2842 (again).
  • Loading branch information
icculus committed May 31, 2015
1 parent 8c9571a commit 870df8a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/video/cocoa/SDL_cocoawindow.m
Expand Up @@ -751,6 +751,14 @@ - (void)mouseDown:(NSEvent *)theEvent
{
int button;

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

if ([self processHitTest:theEvent]) {
return; /* dragging, drop event. */
}
Expand Down

0 comments on commit 870df8a

Please sign in to comment.