Skip to content

Commit

Permalink
macOS init shouldn't used [NSApp sharedApplication].
Browse files Browse the repository at this point in the history
It should either use NSApp because legacy SDLmain created it, or it should
use nil (which is a no-op in Objective-C) because it didn't. Using
sharedApplication will create NSApp if its nil but not set any other state,
causing problems.
  • Loading branch information
icculus committed Feb 15, 2019
1 parent c9ddcc1 commit 7340ad1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SDL12_compat_objc.m
Expand Up @@ -33,7 +33,7 @@

void sdl12_compat_macos_init(void)
{
[[NSApp sharedApplication] setActivationPolicy:NSApplicationActivationPolicyRegular];
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
}
#endif

Expand Down

0 comments on commit 7340ad1

Please sign in to comment.