Jelajahi Sumber

ui/cocoa: Make -full-screen option work on Mac OS X

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>
Programmingkid 10 tahun lalu
induk
melakukan
43227af88a
1 mengubah file dengan 6 tambahan dan 0 penghapusan
  1. 6 0
      ui/cocoa.m

+ 6 - 0
ui/cocoa.m

@@ -1161,6 +1161,12 @@ void cocoa_display_init(DisplayState *ds, int full_screen)
 {
 {
     COCOA_DEBUG("qemu_cocoa: cocoa_display_init\n");
     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));
     dcl = g_malloc0(sizeof(DisplayChangeListener));
 
 
     // register vga output callbacks
     // register vga output callbacks