qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Makes -full-screen option work on Mac OS X
@ 2015-01-12  0:31 Programmingkid
  2015-01-12 16:10 ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Programmingkid @ 2015-01-12  0:31 UTC (permalink / raw)
  To: qemu-devel qemu-devel; +Cc: Peter Maydell

[-- Attachment #1: Type: text/plain, Size: 1976 bytes --]

This patch makes the -full-screen option work under Mac OS X. 

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>

---
 ui/cocoa.m |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/ui/cocoa.m b/ui/cocoa.m
index 685081e..3a70cfc 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -67,6 +67,7 @@ char **gArgv;
 /* bitmap_info is used in drawRect:. Starts with little endian format. */
 static int bitmap_info = kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst;
 SInt32 current_mac_os_version;
+bool set_to_full_screen;

 // keymap conversion
 int keymap[] =
@@ -252,6 +253,20 @@ static void determineMacOSVersion()
     }
 }
 
+// Looks for the -full-screen option being sent to QEMU
+static void scanForFullScreenOption(int argc, char * argv[])
+{
+	set_to_full_screen = false;
+
+	// search for the -full-screen option
+	for(int i = 0; i < argc; i++) {
+	    if(strcmp(argv[i], "-full-screen") == 0) {
+	        set_to_full_screen = true;
+            break;
+	    }
+	}
+}
+
 /*
  ------------------------------------------------------
     QemuCocoaView
@@ -911,6 +926,12 @@ QemuCocoaView *cocoaView;
               didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) contextInfo:NULL];
 #endif
     } else {
+        /* for activating full screen at launch */
+        if (set_to_full_screen == true) {
+            [NSApp activateIgnoringOtherApps: YES];
+            [self toggleFullScreen: nil];
+        }
+
         // or launch QEMU, with the global args
         [self startEmulationWithArgc:gArgc argv:(char **)gArgv];
     }
@@ -1002,6 +1023,8 @@ int main (int argc, const char * argv[]) {
     gArgv = (char **)argv;
     int i;
 
+    scanForFullScreenOption(argc, argv);
+
     /* In case we don't need to display a window, let's not do that */
     for (i = 1; i < argc; i++) {
         const char *opt = argv[i];
-- 
1.7.5.4


[-- Attachment #2: Type: text/html, Size: 12292 bytes --]

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

* Re: [Qemu-devel] [PATCH] Makes -full-screen option work on Mac OS X
  2015-01-12  0:31 [Qemu-devel] [PATCH] Makes -full-screen option work on Mac OS X Programmingkid
@ 2015-01-12 16:10 ` Peter Maydell
  2015-01-12 16:16   ` Programmingkid
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2015-01-12 16:10 UTC (permalink / raw)
  To: Programmingkid; +Cc: qemu-devel qemu-devel

On 12 January 2015 at 00:31, Programmingkid <programmingkidx@gmail.com> wrote:
> This patch makes the -full-screen option work under Mac OS X.
>
> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>

> +// Looks for the -full-screen option being sent to QEMU
> +static void scanForFullScreenOption(int argc, char * argv[])
> +{
> + set_to_full_screen = false;
> +
> + // search for the -full-screen option
> + for(int i = 0; i < argc; i++) {
> +     if(strcmp(argv[i], "-full-screen") == 0) {
> +         set_to_full_screen = true;
> +            break;
> +     }
> + }
> +}

Why do we need to do this rather than just honouring the
full_screen parameter passed into cocoa_display_init() ?

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH] Makes -full-screen option work on Mac OS X
  2015-01-12 16:10 ` Peter Maydell
@ 2015-01-12 16:16   ` Programmingkid
  0 siblings, 0 replies; 3+ messages in thread
From: Programmingkid @ 2015-01-12 16:16 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel qemu-devel


On Jan 12, 2015, at 11:10 AM, Peter Maydell wrote:

> On 12 January 2015 at 00:31, Programmingkid <programmingkidx@gmail.com> wrote:
>> This patch makes the -full-screen option work under Mac OS X.
>> 
>> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
> 
>> +// Looks for the -full-screen option being sent to QEMU
>> +static void scanForFullScreenOption(int argc, char * argv[])
>> +{
>> + set_to_full_screen = false;
>> +
>> + // search for the -full-screen option
>> + for(int i = 0; i < argc; i++) {
>> +     if(strcmp(argv[i], "-full-screen") == 0) {
>> +         set_to_full_screen = true;
>> +            break;
>> +     }
>> + }
>> +}
> 
> Why do we need to do this rather than just honouring the
> full_screen parameter passed into cocoa_display_init() ?

Didn't know about this variable. Will make a new patch that eliminates unneeded code. Thanks. 

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

end of thread, other threads:[~2015-01-12 16:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-12  0:31 [Qemu-devel] [PATCH] Makes -full-screen option work on Mac OS X Programmingkid
2015-01-12 16:10 ` Peter Maydell
2015-01-12 16:16   ` Programmingkid

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