aboutsummaryrefslogtreecommitdiffstats
path: root/cocoa.m
diff options
context:
space:
mode:
authorAndreas Färber <andreas.faerber@web.de>2009-12-14 22:13:27 +0100
committermalc <av1474@comtv.ru>2010-01-07 10:57:34 +0300
commit41ea49b328ef0fa292574af719f92de14b28304d (patch)
treed65d65fce036e49b8a0b0d680d754a20e2521af0 /cocoa.m
parentf49188043b9ca4d28aeea82fa462282f58a36414 (diff)
Cocoa: Shutdown when window is closed
The application is not very useful once the guest window is closed. QEMU is not a document-based application; terminating it automatically saves the user another action and resembles SDL behavior. v2: - Use delegate method, suggested by Juha Riihimäki. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Cc: Juha Riihimäki <juha.riihimaki@nokia.com> Signed-off-by: malc <av1474@comtv.ru>
Diffstat (limited to 'cocoa.m')
-rw-r--r--cocoa.m5
1 files changed, 5 insertions, 0 deletions
diff --git a/cocoa.m b/cocoa.m
index 70c249b11..57dcff814 100644
--- a/cocoa.m
+++ b/cocoa.m
@@ -783,6 +783,11 @@ static int cocoa_keycode_to_qemu(int keycode)
exit(0);
}
+- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication
+{
+ return YES;
+}
+
- (void)startEmulationWithArgc:(int)argc argv:(char**)argv
{
COCOA_DEBUG("QemuCocoaAppController: startEmulationWithArgc\n");