提交 f4918804 编写于 作者: A Andreas Färber 提交者: malc

Cocoa: Don't unconditionally show the window

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: NAndreas Färber <andreas.faerber@web.de>
Cc: Alexander Graf <agraf@suse.de>
Cc: Mike Kronenberg <mike.kronenberg@kronenberg.org>
Signed-off-by: Nmalc <av1474@comtv.ru>
上级 17ccbc27
......@@ -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];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册