We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2347

Summary: On OSX, an SDL app prevents system shutdown.
Product: SDL Reporter: Tim McDaniel <tmcdaniel>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.1   
Hardware: x86_64   
OS: Mac OS X (All)   
Attachments: Patch

Description Tim McDaniel 2014-01-14 21:48:04 UTC
Created attachment 1520 [details]
Patch

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.
Comment 1 Sam Lantinga 2014-02-23 01:56:24 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/05cbb1cb4f27