diff --git a/driver.c b/driver.c index 780dfaed69..a936e1edee 100644 --- a/driver.c +++ b/driver.c @@ -571,7 +571,8 @@ static void init_video_input(void) (g_settings.video.rotation + g_extern.system.rotation) % 4); if (driver.video->suppress_screensaver) - driver.video->suppress_screensaver(driver.video_data, true); + driver.video->suppress_screensaver(driver.video_data, + g_settings.ui.suspend_screensaver_enable); if (!driver.input) { diff --git a/general.h b/general.h index d98dd2565e..a7f847de1d 100644 --- a/general.h +++ b/general.h @@ -182,6 +182,7 @@ struct settings struct { bool menubar_enable; + bool suspend_screensaver_enable; } ui; #ifdef HAVE_MENU diff --git a/retroarch.cfg b/retroarch.cfg index d1290addb1..34ed15d074 100644 --- a/retroarch.cfg +++ b/retroarch.cfg @@ -585,6 +585,12 @@ # Filter files being show in 'Load Content' by supported extensions # menu_navigation_browser_filter_supported_extensions_enable = true +#### UI + +# Suspends the screensaver if set to true. Is a hint that does not necessarily have to be honored +# by video driver. +# suspend_screensaver_enable = true + #### Camera # Override the default camera device the camera driver uses. This is driver dependant. diff --git a/settings.c b/settings.c index 74ffe30001..b59038299b 100644 --- a/settings.c +++ b/settings.c @@ -517,6 +517,7 @@ static void config_set_defaults(void) #endif g_settings.ui.menubar_enable = true; + g_settings.ui.suspend_screensaver_enable = true; g_settings.location.allow = false; g_settings.camera.allow = false; @@ -1295,6 +1296,7 @@ static bool config_load_file(const char *path, bool set_defaults) } CONFIG_GET_BOOL(ui.menubar_enable, "ui_menubar_enable"); + CONFIG_GET_BOOL(ui.suspend_screensaver_enable, "suspend_screensaver_enable"); CONFIG_GET_BOOL(fps_show, "fps_show"); CONFIG_GET_BOOL(fps_monitor_enable, "fps_monitor_enable"); CONFIG_GET_BOOL(load_dummy_on_core_shutdown, "load_dummy_on_core_shutdown"); @@ -1778,6 +1780,7 @@ bool config_save_file(const char *path) g_settings.load_dummy_on_core_shutdown); config_set_bool(conf, "fps_show", g_settings.fps_show); config_set_bool(conf, "ui_menubar_enable", g_settings.ui.menubar_enable); + config_set_bool(conf, "suspend_screensaver_enable", g_settings.ui.suspend_screensaver_enable); config_set_bool(conf, "fps_monitor_enable", g_settings.fps_monitor_enable); config_set_path(conf, "libretro_path", g_settings.libretro); config_set_path(conf, "libretro_directory", g_settings.libretro_directory); diff --git a/settings_data.c b/settings_data.c index ba5521abde..d7f7af4712 100644 --- a/settings_data.c +++ b/settings_data.c @@ -5387,6 +5387,18 @@ static bool setting_data_append_list_ui_options( general_write_handler, general_read_handler); + CONFIG_BOOL( + g_settings.ui.suspend_screensaver_enable, + "suspend_screensaver_enable", + "Suspend Screensaver Enable Hint", + true, + "OFF", + "ON", + group_info.name, + subgroup_info.name, + general_write_handler, + general_read_handler); + END_SUB_GROUP(list, list_info); END_GROUP(list, list_info);