Makes -full-screen option work on Mac OS X
PATCH 1/1 Makes -full-screen option work on Mac OS X
This patch makes the -full-screen option work under Mac OS X.
Signed-off-by John Arbuckle <[email protected]>
--- ui/cocoa.m | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-)
ui/cocoa.m +23 -0
@@ -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];
Signature · 1 line
1.7.5.4
Quoted 7 lines · Programmingkid
This patch makes the -full-screen option work under Mac OS X.
Signed-off-by John Arbuckle <[email protected]>ui/cocoa.m +3
-0+// Looks for the -full-screen option being sent to QEMU +static void scanForFullScreenOption(int argc, char * argv[]) +{
ui/cocoa.m static void determineMacOSVersion() · line 268
Quoted 10 lines
ui/cocoa.m +10
-0+ 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
Quoted 5 lines · Peter Maydell
Quoted 3 lines · Programmingkid
This patch makes the -full-screen option work under Mac OS X.
Signed-off-by John Arbuckle <[email protected]>
Quoted 16 lines
ui/cocoa.m static void determineMacOSVersion() · line 268
Quoted 13 lines
ui/cocoa.m +13
-0+// 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_screenparameter passed intococoa_display_init()?
Didn't know about this variable. Will make a new patch that eliminates unneeded code. Thanks.