Allow toggling monitor index in RGUI.

This commit is contained in:
Themaister 2014-04-06 15:41:53 +02:00
parent 0ae933ea8b
commit 2e3ca36010
5 changed files with 38 additions and 1 deletions

View File

@ -1900,6 +1900,7 @@ void menu_populate_entries(void *data, unsigned menu_type)
file_list_push(rgui->selection_buf, "Windowed Scale (Y)", RGUI_SETTINGS_VIDEO_WINDOW_SCALE_Y, 0);
#endif
file_list_push(rgui->selection_buf, "Crop Overscan (reload)", RGUI_SETTINGS_VIDEO_CROP_OVERSCAN, 0);
file_list_push(rgui->selection_buf, "Monitor Index", RGUI_SETTINGS_VIDEO_MONITOR_INDEX, 0);
file_list_push(rgui->selection_buf, "Estimated Monitor FPS", RGUI_SETTINGS_VIDEO_REFRESH_RATE_AUTO, 0);
break;
case RGUI_SETTINGS_CORE_OPTIONS:

View File

@ -87,6 +87,7 @@ typedef enum
RGUI_SETTINGS_VIDEO_WINDOW_SCALE_Y,
RGUI_SETTINGS_VIDEO_CROP_OVERSCAN,
RGUI_SETTINGS_VIDEO_REFRESH_RATE_AUTO,
RGUI_SETTINGS_VIDEO_MONITOR_INDEX,
RGUI_SETTINGS_VIDEO_OPTIONS_LAST,
RGUI_SETTINGS_SHADER_OPTIONS,
RGUI_SETTINGS_SHADER_FILTER,

View File

@ -1595,6 +1595,33 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
}
break;
case RGUI_SETTINGS_VIDEO_MONITOR_INDEX:
switch (action)
{
case RGUI_ACTION_START:
g_settings.video.monitor_index = 0;
rarch_set_fullscreen(g_settings.video.fullscreen);
break;
case RGUI_ACTION_OK:
case RGUI_ACTION_RIGHT:
g_settings.video.monitor_index++;
rarch_set_fullscreen(g_settings.video.fullscreen);
break;
case RGUI_ACTION_LEFT:
if (g_settings.video.monitor_index)
{
g_settings.video.monitor_index++;
rarch_set_fullscreen(g_settings.video.fullscreen);
}
break;
default:
break;
}
break;
case RGUI_SETTINGS_VIDEO_REFRESH_RATE_AUTO:
switch (action)
{
@ -1917,6 +1944,12 @@ void menu_set_settings_label(char *type_str, size_t type_str_size, unsigned *w,
strlcpy(type_str, g_settings.menu.driver, type_str_size);
break;
#endif
case RGUI_SETTINGS_VIDEO_MONITOR_INDEX:
if (g_settings.video.monitor_index)
snprintf(type_str, type_str_size, "%u", g_settings.video.monitor_index);
else
strlcpy(type_str, "0 (Auto)", type_str_size);
break;
case RGUI_SETTINGS_VIDEO_REFRESH_RATE_AUTO:
{
double refresh_rate = 0.0;

View File

@ -524,7 +524,8 @@ static bool gfx_ctx_set_video_mode(void *data,
}
// Find desired video mode, and use that.
if (width == 0 && height == 0)
// If not fullscreen, we get desired windowed size, which is not appropriate.
if ((width == 0 && height == 0) || !fullscreen)
g_drm_mode = &g_connector->modes[0];
else
{

View File

@ -1256,6 +1256,7 @@ bool config_save_file(const char *path)
config_set_bool(conf, "video_threaded", g_settings.video.threaded);
config_set_bool(conf, "video_fullscreen", g_settings.video.fullscreen);
config_set_float(conf, "video_refresh_rate", g_settings.video.refresh_rate);
config_set_int(conf, "video_monitor_index", g_settings.video.monitor_index);
config_set_int(conf, "video_fullscreen_x", g_settings.video.fullscreen_x);
config_set_int(conf, "video_fullscreen_y", g_settings.video.fullscreen_y);
config_set_string(conf, "video_driver", g_settings.video.driver);