From patchwork Sun Dec 13 02:55:39 2009 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: 41018 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 D2425B6EF2 for ; Sun, 13 Dec 2009 14:13:10 +1100 (EST) Received: from localhost ([127.0.0.1]:52448 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NJetP-0005FR-Ik for incoming@patchwork.ozlabs.org; Sat, 12 Dec 2009 22:13:07 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NJed6-0007Kw-Nu for qemu-devel@nongnu.org; Sat, 12 Dec 2009 21:56:16 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NJecy-0007Gm-FU for qemu-devel@nongnu.org; Sat, 12 Dec 2009 21:56:13 -0500 Received: from [199.232.76.173] (port=45240 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NJecy-0007GY-5F for qemu-devel@nongnu.org; Sat, 12 Dec 2009 21:56:08 -0500 Received: from fmmailgate02.web.de ([217.72.192.227]:32811) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NJecx-0000fd-Bq for qemu-devel@nongnu.org; Sat, 12 Dec 2009 21:56:07 -0500 Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215]) by fmmailgate02.web.de (Postfix) with ESMTP id 8528C1485D4AE; Sun, 13 Dec 2009 03:56:05 +0100 (CET) Received: from [84.148.98.194] (helo=localhost.localdomain) by smtp07.web.de with asmtp (WEB.DE 4.110 #314) id 1NJecv-0000uu-00; Sun, 13 Dec 2009 03:56:05 +0100 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Sun, 13 Dec 2009 03:55:39 +0100 Message-Id: <1260672941-9365-10-git-send-email-andreas.faerber@web.de> X-Mailer: git-send-email 1.6.5.3 In-Reply-To: <1260672941-9365-9-git-send-email-andreas.faerber@web.de> References: <1260672941-9365-1-git-send-email-andreas.faerber@web.de> <1260672941-9365-2-git-send-email-andreas.faerber@web.de> <1260672941-9365-3-git-send-email-andreas.faerber@web.de> <1260672941-9365-4-git-send-email-andreas.faerber@web.de> <1260672941-9365-5-git-send-email-andreas.faerber@web.de> <1260672941-9365-6-git-send-email-andreas.faerber@web.de> <1260672941-9365-7-git-send-email-andreas.faerber@web.de> <1260672941-9365-8-git-send-email-andreas.faerber@web.de> <1260672941-9365-9-git-send-email-andreas.faerber@web.de> MIME-Version: 1.0 X-Sender: Andreas.Faerber@web.de X-Provags-ID: V01U2FsdGVkX184H6IGJ+lt4k3RuZ3U7ujSpDuY+8d8igUF02mk mrzG/49t9p8Fra3Euv4kFGtimthocddT7IxMF2OOX3Tzskulzy 7YWDgTpcKWP/Rlo9PBTA== X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 Cc: Alexander Graf , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Mike Kronenberg Subject: [Qemu-devel] [PATCH 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. Signed-off-by: Andreas Färber Cc: Mike Kronenberg Cc: Alexander Graf --- cocoa.m | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/cocoa.m b/cocoa.m index 70c249b..09ed3cd 100644 --- a/cocoa.m +++ b/cocoa.m @@ -712,6 +712,7 @@ static int cocoa_keycode_to_qemu(int keycode) - (void)toggleFullScreen:(id)sender; - (void)showQEMUDoc:(id)sender; - (void)showQEMUTec:(id)sender; +- (void)windowWillClose:(NSNotification *)notification; @end @implementation QemuCocoaAppController @@ -737,6 +738,7 @@ static int cocoa_keycode_to_qemu(int keycode) fprintf(stderr, "(cocoa) can't create window\n"); exit(1); } + [normalWindow setDelegate:self]; [normalWindow setAcceptsMouseMovedEvents:YES]; [normalWindow setTitle:[NSString stringWithFormat:@"QEMU"]]; [normalWindow setContentView:cocoaView]; @@ -835,6 +837,11 @@ static int cocoa_keycode_to_qemu(int keycode) [[NSWorkspace sharedWorkspace] openFile:[NSString stringWithFormat:@"%@/../doc/qemu/qemu-tech.html", [[NSBundle mainBundle] resourcePath]] withApplication:@"Help Viewer"]; } + +- (void)windowWillClose:(NSNotification *)notification +{ + [NSApp terminate:self]; +} @end