From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 13 Dec 2009 03:55:39 +0100 Message-Id: <1260672941-9365-10-git-send-email-andreas.faerber@web.de> 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 Content-Type: text/plain; charset=UTF-8 Sender: andreas.faerber@web.de Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 09/11] Cocoa: Shutdown when window is closed List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexander Graf , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Mike Kronenberg 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=C3=A4rber 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 =20 @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 Vie= wer"]; } + +- (void)windowWillClose:(NSNotification *)notification +{ + [NSApp terminate:self]; +} @end =20 =20 --=20 1.6.5.3