From: Alexander Graf <agraf@suse.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Don't show cocoa window when it's unused
Date: Sat, 24 Jan 2009 22:36:25 +0100 [thread overview]
Message-ID: <1232832985-21402-1-git-send-email-agraf@suse.de> (raw)
While working with Qemu on Mac OS X I got really annoyed by it
showing a window every time I start it with -nographic or -vnc.
This patch (uglyly) checks if we need to show that window at all
and if not behaves the same way the non-cocoa version does.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
cocoa.m | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/cocoa.m b/cocoa.m
index fe13952..9398507 100644
--- a/cocoa.m
+++ b/cocoa.m
@@ -853,6 +853,21 @@ int main (int argc, const char * argv[]) {
gArgc = argc;
gArgv = (char **)argv;
CPSProcessSerNum PSN;
+ int noCocoa = 0;
+ 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")) {
+ noCocoa = 1;
+ break;
+ }
+ }
+
+ if (noCocoa)
+ return qemu_main(argc, argv);
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];
--
1.6.0.2
next reply other threads:[~2009-01-24 21:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-24 21:36 Alexander Graf [this message]
2009-01-24 21:47 ` [Qemu-devel] [PATCH] Don't show cocoa window when it's unused Samuel Benson
2009-01-24 22:50 ` Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1232832985-21402-1-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).