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 - On OSX, an SDL app prevents system shutdown.
Summary: On OSX, an SDL app prevents system shutdown.
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.1
Hardware: x86_64 Mac OS X (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-14 21:48 UTC by Tim McDaniel
Modified: 2014-02-23 01:56 UTC (History)
0 users

See Also:


Attachments
Patch (1.18 KB, text/plain)
2014-01-14 21:48 UTC, Tim McDaniel
Details

Note You need to log in before you can comment on or make changes to this bug.
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