From patchwork Wed Jan 6 22:47:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 42351 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 74E40B6F04 for ; Thu, 7 Jan 2010 09:53:21 +1100 (EST) Received: from localhost ([127.0.0.1]:53262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSekg-00029c-8I for incoming@patchwork.ozlabs.org; Wed, 06 Jan 2010 17:53:18 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSef8-0007PA-3P for qemu-devel@nongnu.org; Wed, 06 Jan 2010 17:47:34 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSef3-0007M4-9R for qemu-devel@nongnu.org; Wed, 06 Jan 2010 17:47:33 -0500 Received: from [199.232.76.173] (port=50115 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSef3-0007Lv-5B for qemu-devel@nongnu.org; Wed, 06 Jan 2010 17:47:29 -0500 Received: from fmmailgate01.web.de ([217.72.192.221]:50468) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NSef2-00054b-EF for qemu-devel@nongnu.org; Wed, 06 Jan 2010 17:47:28 -0500 Received: from smtp05.web.de (fmsmtp05.dlan.cinetic.de [172.20.4.166]) by fmmailgate01.web.de (Postfix) with ESMTP id 160891447A550; Wed, 6 Jan 2010 23:47:28 +0100 (CET) Received: from [84.148.52.231] (helo=localhost.localdomain) by smtp05.web.de with asmtp (WEB.DE 4.110 #314) id 1NSef1-0001R8-01; Wed, 06 Jan 2010 23:47:27 +0100 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Wed, 6 Jan 2010 23:47:15 +0100 Message-Id: <1262818037-926-10-git-send-email-andreas.faerber@web.de> X-Mailer: git-send-email 1.6.5.3 In-Reply-To: <1262818037-926-9-git-send-email-andreas.faerber@web.de> References: <1262818037-926-1-git-send-email-andreas.faerber@web.de> <1262818037-926-2-git-send-email-andreas.faerber@web.de> <1262818037-926-3-git-send-email-andreas.faerber@web.de> <1262818037-926-4-git-send-email-andreas.faerber@web.de> <1262818037-926-5-git-send-email-andreas.faerber@web.de> <1262818037-926-6-git-send-email-andreas.faerber@web.de> <1262818037-926-7-git-send-email-andreas.faerber@web.de> <1262818037-926-8-git-send-email-andreas.faerber@web.de> <1262818037-926-9-git-send-email-andreas.faerber@web.de> MIME-Version: 1.0 X-Sender: Andreas.Faerber@web.de X-Provags-ID: V01U2FsdGVkX1//7pc/jb8aWUslvkmo5rID68wCn45yyo3ktApF uQGAi34O+A+hcD9nafRLSEPSO5ZvgwG+X9ZWrcMxMjbJP4//9t lTqnzMvAFu4zdZu7fAvg== X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , =?UTF-8?q?Juha=20Riihim=C3=A4ki?= Subject: [Qemu-devel] [PATCH v2 RESEND 09/11] Cocoa: Shutdown when window is closed X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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");