(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.

This commit is contained in:
meancoot 2013-09-12 18:42:39 -04:00
parent 3e7f101137
commit d92fb6ac9c
2 changed files with 8 additions and 13 deletions

View File

@ -268,10 +268,6 @@ static const char* get_axis_name(const rarch_setting_t* setting)
@end @end
@protocol RASettingView
@property const rarch_setting_t* setting;
@end
@interface RASettingsDelegate : NSObject<NSTableViewDataSource, NSTableViewDelegate, @interface RASettingsDelegate : NSObject<NSTableViewDataSource, NSTableViewDelegate,
NSOutlineViewDataSource, NSOutlineViewDelegate, NSOutlineViewDataSource, NSOutlineViewDelegate,
NSWindowDelegate> NSWindowDelegate>

View File

@ -344,8 +344,6 @@ bool apple_game_view_has_focus(void)
bool apple_set_video_mode(unsigned width, unsigned height, bool fullscreen) bool apple_set_video_mode(unsigned width, unsigned height, bool fullscreen)
{ {
__block bool result = true;
#ifdef OSX #ifdef OSX
dispatch_sync(dispatch_get_main_queue(), 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 (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); RARCH_WARN("video_monitor_index is greater than the number of connected monitors; using main screen instead.\n");
result = false; monitor = 0;
return;
} }
[g_view enterFullScreenMode:[NSScreen screens][g_settings.video.monitor_index] withOptions:nil]; [g_view enterFullScreenMode:[NSScreen screens][monitor] withOptions:nil];
[NSCursor hide]; [NSCursor hide];
} }
else if (!fullscreen && g_has_went_fullscreen) 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? // TODO: Maybe iOS users should be apple to show/hide the status bar here?
return result; return true;
} }
#ifdef IOS #ifdef IOS