mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
(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:
parent
3e7f101137
commit
d92fb6ac9c
@ -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>
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user