Fixed bug 2395 - OSX: App name in the menu bar is not localized.

Tim McDaniel

On OSX, the app name in the menu bar is not localized.  This can be fixed using the following implementation for GetApplicationName in SDL_cocoaevents.m:

static NSString *
GetApplicationName(void)
{
    NSDictionary *dict;
    NSString *appName = 0;

    appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
    if (!appName)
        appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];

    if (![appName length])
        appName = [[NSProcessInfo processInfo] processName];

    return appName;
}
Don't fail initialization if the helper window class already exists.
Fixed bug 2347 - On OSX, an SDL app prevents system shutdown.

Tim McDaniel

On OSX, an SDL app forces a system shutdown to be cancelled.  This happens because [SDLAppDelegate applicationShouldTerminate] returns NSTerminateCancel.  A better approach is to subclass NSApplication and override terminate to do nothing except call SDL_SendQuit.  In response to a system shutdown notification, this allows the normal SDL Quit event processing to occur, and if the app then terminates, system shutdown occurs normally.  Please see the attached patch, based on SDL 2.0.1.