|
|
@@ -30,9 +30,25 @@
|
|
|
[NSApp activateIgnoringOtherApps:YES];
|
|
|
}
|
|
|
|
|
|
+- (BOOL)applicationShouldTerminate:(NSApplication *)app {
|
|
|
+ if (cocoadisplay_cat.is_debug()) {
|
|
|
+ cocoadisplay_cat.debug()
|
|
|
+ << "Received applicationShouldTerminate, closing all Cocoa windows\n";
|
|
|
+ }
|
|
|
+ // Call performClose on all the windows. This should make ShowBase shut down.
|
|
|
+ for (NSWindow *window in [app windows]) {
|
|
|
+ [window performClose:nil];
|
|
|
+ }
|
|
|
+ return FALSE;
|
|
|
+}
|
|
|
+
|
|
|
- (void)applicationWillTerminate:(NSNotification *)notification {
|
|
|
// The application is about to be closed, tell the graphics engine to close
|
|
|
// all the windows.
|
|
|
+ if (cocoadisplay_cat.is_debug()) {
|
|
|
+ cocoadisplay_cat.debug()
|
|
|
+ << "Received applicationWillTerminate, removing all windows\n";
|
|
|
+ }
|
|
|
_engine->remove_all_windows();
|
|
|
}
|
|
|
|