From patchwork Wed Jan 6 22:47:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [v2,RESEND,09/11] Cocoa: Shutdown when window is closed Date: Wed, 06 Jan 2010 12:47:15 -0000 From: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 42351 Message-Id: <1262818037-926-10-git-send-email-andreas.faerber@web.de> To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , =?UTF-8?q?Juha=20Riihim=C3=A4ki?= 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 --- cocoa.m | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/cocoa.m b/cocoa.m index 70c249b..57dcff8 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");