From 41ea49b328ef0fa292574af719f92de14b28304d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andreas=20F=C3=A4rber?= Date: Mon, 14 Dec 2009 22:13:27 +0100 Subject: [PATCH] Cocoa: Shutdown when window is closed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Cc: Juha Riihimäki Signed-off-by: malc --- cocoa.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cocoa.m b/cocoa.m index 70c249b113..57dcff8147 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"); -- 2.11.0