[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/11] Cocoa: Shutdown when window is closed
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH 09/11] Cocoa: Shutdown when window is closed |
Date: |
Sun, 13 Dec 2009 03:55:39 +0100 |
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 <address@hidden>
Cc: Mike Kronenberg <address@hidden>
Cc: Alexander Graf <address@hidden>
---
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
--
1.6.5.3
- [Qemu-devel] Cocoa: ppc64 host support and various improvements, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 01/11] Cocoa: ppc64 host support, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 02/11] Cocoa: Silence warning for cocoa_keycode_to_qemu, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 03/11] Cocoa: Silence warning on Big Endian host, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 04/11] Cocoa: Silence type warning, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 05/11] Cocoa: Fix compilation on Mac OS X v10.4 and earlier, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 06/11] Cocoa: Mark the View as opaque, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 07/11] Cocoa: Redraw the View asynchronously, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 08/11] Cocoa: Don't unconditionally show the window, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 09/11] Cocoa: Shutdown when window is closed,
Andreas Färber <=
- [Qemu-devel] [PATCH 10/11] Cocoa: Suppress window resize animation, Andreas Färber, 2009/12/12
- [Qemu-devel] [PATCH 11/11] Cocoa: Use optimized drawing for the window, Andreas Färber, 2009/12/12
- Re: [Qemu-devel] [PATCH 09/11] Cocoa: Shutdown when window is closed, Juha.Riihimaki, 2009/12/14
- [Qemu-devel] [PATCH v2 09/11] Cocoa: Shutdown when window is closed, Andreas Färber, 2009/12/14
- Re: [Qemu-devel] [PATCH 09/11] Cocoa: Shutdown when window is closed, Andreas Färber, 2009/12/14