mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
Cocoa: ignore mouseDown events in a window's titlebar.
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).
This commit is contained in:
parent
8c9571a26b
commit
870df8adab
@ -751,6 +751,14 @@ SetWindowStyle(SDL_Window * window, unsigned int style)
|
||||
{
|
||||
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. */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user