Generalized the hint for whether the application gets a mouse event when clicking on the window to activate it, and is now named SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH.

The behavior is defined to not receive the click event, and this hint allows you to override that.
This commit is contained in:
Sam Lantinga 2016-09-29 13:34:49 -07:00
parent 273f71a704
commit 5d60a58a8b
2 changed files with 24 additions and 16 deletions

View file

@ -1118,7 +1118,11 @@ SetWindowStyle(SDL_Window * window, NSUInteger style)
- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
{
const char *hint = SDL_GetHint(SDL_HINT_MAC_MOUSE_FOCUS_CLICKTHROUGH);
const char *hint = SDL_GetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH);
if (!hint) {
/* Check older hint for backwards compatibility */
hint = SDL_GetHint("SDL_MAC_MOUSE_FOCUS_CLICKTHROUGH");
}
return hint && *hint != '0';
}
@end