From patchwork Wed Jan 6 22:47:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [v2,RESEND,08/11] Cocoa: Don't unconditionally show the window X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 42354 Message-Id: <1262818037-926-9-git-send-email-andreas.faerber@web.de> To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , Mike Kronenberg , Alexander Graf Date: Wed, 6 Jan 2010 23:47:14 +0100 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= List-Id: qemu-devel.nongnu.org When QEMU was launched in no-graphic, Curses or VNC mode, don't run it as a Cocoa application. Based on patch by Alexander Graf. v1: - Avoid type mismatch warning for argv - Drop noCocoa variable - Coding Style changes Signed-off-by: Andreas Färber Cc: Alexander Graf Cc: Mike Kronenberg --- cocoa.m | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/cocoa.m b/cocoa.m index d5f941b..70c249b 100644 --- a/cocoa.m +++ b/cocoa.m @@ -855,6 +855,16 @@ int main (int argc, const char * argv[]) { gArgc = argc; gArgv = (char **)argv; CPSProcessSerNum PSN; + int i; + + /* In case we don't need to display a window, let's not do that */ + for (i = 1; i < argc; i++) { + if (!strcmp(argv[i], "-vnc") || + !strcmp(argv[i], "-nographic") || + !strcmp(argv[i], "-curses")) { + return qemu_main(gArgc, gArgv); + } + } NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; [NSApplication sharedApplication];