From d92fb6ac9c631804dfdb1416efb94bc917c5ffda Mon Sep 17 00:00:00 2001 From: meancoot Date: Thu, 12 Sep 2013 18:42:39 -0400 Subject: [PATCH] (OSX) Now when video_monitor_index is out of range a warning is logged and the main screen is used instead. Previously a modal error was displayed and retroarch would exit when it was dismissed. --- apple/OSX/settings.m | 4 ---- apple/common/RAGameView.m | 17 ++++++++--------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/apple/OSX/settings.m b/apple/OSX/settings.m index 66ce2bf1cd..51226fee4b 100644 --- a/apple/OSX/settings.m +++ b/apple/OSX/settings.m @@ -268,10 +268,6 @@ static const char* get_axis_name(const rarch_setting_t* setting) @end -@protocol RASettingView -@property const rarch_setting_t* setting; -@end - @interface RASettingsDelegate : NSObject diff --git a/apple/common/RAGameView.m b/apple/common/RAGameView.m index 8fec390435..30a4e01d0e 100644 --- a/apple/common/RAGameView.m +++ b/apple/common/RAGameView.m @@ -344,8 +344,6 @@ bool apple_game_view_has_focus(void) bool apple_set_video_mode(unsigned width, unsigned height, bool fullscreen) { - __block bool result = true; - #ifdef OSX dispatch_sync(dispatch_get_main_queue(), ^{ @@ -353,14 +351,15 @@ bool apple_set_video_mode(unsigned width, unsigned height, bool fullscreen) if (fullscreen && !g_has_went_fullscreen) { - if (g_settings.video.monitor_index >= [NSScreen screens].count) + unsigned monitor = g_settings.video.monitor_index; + + if (monitor >= [NSScreen screens].count) { - apple_display_alert(@"Could not go fullscreen: Monitor index out of range.", nil); - result = false; - return; + RARCH_WARN("video_monitor_index is greater than the number of connected monitors; using main screen instead.\n"); + monitor = 0; } - - [g_view enterFullScreenMode:[NSScreen screens][g_settings.video.monitor_index] withOptions:nil]; + + [g_view enterFullScreenMode:[NSScreen screens][monitor] withOptions:nil]; [NSCursor hide]; } else if (!fullscreen && g_has_went_fullscreen) @@ -378,7 +377,7 @@ bool apple_set_video_mode(unsigned width, unsigned height, bool fullscreen) // TODO: Maybe iOS users should be apple to show/hide the status bar here? - return result; + return true; } #ifdef IOS