qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Don't show cocoa window when it's unused
@ 2009-01-24 21:36 Alexander Graf
  2009-01-24 21:47 ` Samuel Benson
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Graf @ 2009-01-24 21:36 UTC (permalink / raw)
  To: qemu-devel

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] Don't show cocoa window when it's unused
  2009-01-24 21:36 [Qemu-devel] [PATCH] Don't show cocoa window when it's unused Alexander Graf
@ 2009-01-24 21:47 ` Samuel Benson
  2009-01-24 22:50   ` Alexander Graf
  0 siblings, 1 reply; 3+ messages in thread
From: Samuel Benson @ 2009-01-24 21:47 UTC (permalink / raw)
  To: qemu-devel


On Jan 24, 2009, at 3:36 PM, Alexander Graf wrote:

> 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

I'm currently working on updating cocoa.m for the displaystate  
changes, and if you don't mind,
I'll gladly incorporate this into the patch I'm rewriting.

I do have a question though, without the window, how would you be able  
to access the monitor,
or any of the consoles for that matter?. Does no -nographic or -vnc  
automatically assume
-monitor stdio?

	—Sam

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] Don't show cocoa window when it's unused
  2009-01-24 21:47 ` Samuel Benson
@ 2009-01-24 22:50   ` Alexander Graf
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Graf @ 2009-01-24 22:50 UTC (permalink / raw)
  To: qemu-devel@nongnu.org





On 24.01.2009, at 22:47, Samuel Benson <qemu_ml@digitalescape.info>  
wrote:

>
> On Jan 24, 2009, at 3:36 PM, Alexander Graf wrote:
>
>> 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
>
> I'm currently working on updating cocoa.m for the displaystate  
> changes, and if you don't mind,
> I'll gladly incorporate this into the patch I'm rewriting.

Sure :) I don't really think this is anything near advanced code or  
things your patches will touch, but if you like, go ahead and take it  
into your series. I really was merely annoyed by it while playing  
around a bit today.

>
>
> I do have a question though, without the window, how would you be  
> able to access the monitor,
> or any of the consoles for that matter?. Does no -nographic or -vnc  
> automatically assume
> -monitor stdio?

-nographic routes monitor/serial port to stdio
-vnc replaces cocoa completely, so you get the monitor by pressing  
ctrl-alt-2 in the vnc window

Alex

>
>
>    ―Sam
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-24 22:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-24 21:36 [Qemu-devel] [PATCH] Don't show cocoa window when it's unused Alexander Graf
2009-01-24 21:47 ` Samuel Benson
2009-01-24 22:50   ` Alexander Graf

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).