diff mbox

[PULL,02/10] ui/cocoa: Make -full-screen option work on Mac OS X

Message ID 1432023835-2274-3-git-send-email-peter.maydell@linaro.org
State Accepted
Commit 43227af88a36faed50cedb0c7cef71a49c0be9d2
Headers show

Commit Message

Peter Maydell May 19, 2015, 8:23 a.m. UTC
From: Programmingkid <programmingkidx@gmail.com>

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 | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox

Patch

diff --git a/ui/cocoa.m b/ui/cocoa.m
index 351b71f..d1d29bc 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -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