ui/cocoa: Make -full-screen option work on Mac OS X
authorProgrammingkid <programmingkidx@gmail.com>
Tue, 19 May 2015 08:11:17 +0000 (09:11 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 19 May 2015 08:11:17 +0000 (09:11 +0100)
This patch makes the -full-screen option actually instruct QEMU to
enter fullscreen at startup, on Mac OS X.

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
ui/cocoa.m

index 351b71ffad532ae6103732038acf2ace72397d31..d1d29bc304b816ed46fcd9fc835257654b8437e8 100644 (file)
@@ -1161,6 +1161,12 @@ void cocoa_display_init(DisplayState *ds, int full_screen)
 {
     COCOA_DEBUG("qemu_cocoa: cocoa_display_init\n");
 
+    /* if fullscreen mode is to be used */
+    if (full_screen == true) {
+        [NSApp activateIgnoringOtherApps: YES];
+        [(QemuCocoaAppController *)[[NSApplication sharedApplication] delegate] toggleFullScreen: nil];
+    }
+
     dcl = g_malloc0(sizeof(DisplayChangeListener));
 
     // register vga output callbacks