mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Mac: don't ignore mouse clicks on the top pixel of a window (thanks, Joshua!).
Fixes Bugzilla #3190.
This commit is contained in:
parent
61518bce6b
commit
326b357804
@ -823,7 +823,14 @@ SetWindowStyle(SDL_Window * window, unsigned int style)
|
|||||||
|
|
||||||
/* Ignore events that aren't inside the client area (i.e. title bar.) */
|
/* Ignore events that aren't inside the client area (i.e. title bar.) */
|
||||||
if ([theEvent window]) {
|
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)) {
|
if (!NSPointInRect([theEvent locationInWindow], windowRect)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user