diff --git a/config.def.h b/config.def.h index 443809ba5e..61a4463a42 100644 --- a/config.def.h +++ b/config.def.h @@ -865,6 +865,9 @@ static const bool audio_enable_menu_bgm = false; * duration when taking a screenshot*/ #define DEFAULT_NOTIFICATION_SHOW_SCREENSHOT_FLASH 0 +/*Display a notification when setting the refresh rate*/ +#define DEFAULT_NOTIFICATION_SHOW_REFRESH_RATE true + /* Output samplerate. */ #ifdef GEKKO #define DEFAULT_OUTPUT_RATE 32000 diff --git a/configuration.c b/configuration.c index dc55f9218b..89e801cce9 100644 --- a/configuration.c +++ b/configuration.c @@ -1500,6 +1500,7 @@ static struct config_bool_setting *populate_settings_bool( #ifdef HAVE_SCREENSHOTS SETTING_BOOL("notification_show_screenshot", &settings->bools.notification_show_screenshot, true, DEFAULT_NOTIFICATION_SHOW_SCREENSHOT, false); #endif + SETTING_BOOL("notification_show_refresh_rate", &settings->bools.notification_show_refresh_rate, true, DEFAULT_NOTIFICATION_SHOW_REFRESH_RATE, false); SETTING_BOOL("menu_widget_scale_auto", &settings->bools.menu_widget_scale_auto, true, DEFAULT_MENU_WIDGET_SCALE_AUTO, false); SETTING_BOOL("audio_enable_menu", &settings->bools.audio_enable_menu, true, audio_enable_menu, false); SETTING_BOOL("audio_enable_menu_ok", &settings->bools.audio_enable_menu_ok, true, audio_enable_menu_ok, false); diff --git a/configuration.h b/configuration.h index 81f3505164..da99d7b7d8 100644 --- a/configuration.h +++ b/configuration.h @@ -545,6 +545,7 @@ typedef struct settings bool notification_show_set_initial_disk; bool notification_show_fast_forward; bool notification_show_screenshot; + bool notification_show_refresh_rate; bool menu_widget_scale_auto; bool menu_show_start_screen; bool menu_pause_libretro; diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 0cf8fa4f5f..8e495c460c 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -4540,6 +4540,10 @@ MSG_HASH( MENU_ENUM_LABEL_NOTIFICATION_SHOW_SCREENSHOT_FLASH, "notification_show_screenshot_flash" ) +MSG_HASH( + MENU_ENUM_LABEL_NOTIFICATION_SHOW_REFRESH_RATE, + "notification_show_refresh_rate" + ) MSG_HASH( MENU_ENUM_LABEL_VIDEO_SHADERS_ENABLE, "video_shader_enable" diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 8ba605cb65..dd849473e0 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -3748,6 +3748,14 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_SCREENSHOT_FLASH_FAST, "ON (Fast)" ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_REFRESH_RATE, + "Refresh Rate Notifications" + ) +MSG_HASH( + MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_REFRESH_RATE, + "Display an on-screen message when setting the refresh rate." + ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_FONT_PATH, "Notification Font" diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 6d60b0caa9..92c9d426c8 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -419,6 +419,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_notification_show_screenshot, MENU_ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_notification_show_screenshot_duration, MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_SCREENSHOT_DURATION) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_notification_show_screenshot_flash, MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_SCREENSHOT_FLASH) #endif +DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_notification_show_refresh_rate, MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_REFRESH_RATE) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_window_width, MENU_ENUM_SUBLABEL_VIDEO_WINDOW_WIDTH) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_window_height, MENU_ENUM_SUBLABEL_VIDEO_WINDOW_HEIGHT) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_fullscreen_x, MENU_ENUM_SUBLABEL_VIDEO_FULLSCREEN_X) @@ -3210,6 +3211,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_notification_show_screenshot_flash); break; #endif + case MENU_ENUM_LABEL_NOTIFICATION_SHOW_REFRESH_RATE: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_notification_show_refresh_rate); + break; case MENU_ENUM_LABEL_RESTART_RETROARCH: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_restart_retroarch); break; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 1fd7184e0c..8f8152caff 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -7954,6 +7954,7 @@ unsigned menu_displaylist_build_list( #ifdef HAVE_SCREENSHOTS bool notification_show_screenshot = settings->bools.notification_show_screenshot; #endif + bool notification_show_refresh_rate = settings->bools.notification_show_refresh_rate; #endif menu_displaylist_build_info_selective_t build_list[] = { {MENU_ENUM_LABEL_FPS_SHOW, PARSE_ONLY_BOOL, true }, @@ -7974,6 +7975,7 @@ unsigned menu_displaylist_build_list( {MENU_ENUM_LABEL_NOTIFICATION_SHOW_SCREENSHOT_DURATION, PARSE_ONLY_UINT, false }, {MENU_ENUM_LABEL_NOTIFICATION_SHOW_SCREENSHOT_FLASH, PARSE_ONLY_UINT, false }, #endif + {MENU_ENUM_LABEL_NOTIFICATION_SHOW_REFRESH_RATE, PARSE_ONLY_BOOL, true }, }; for (i = 0; i < ARRAY_SIZE(build_list); i++) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 519124536a..c253a28dfe 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -13303,6 +13303,21 @@ static bool setting_append_list( #endif #endif + CONFIG_BOOL( + list, list_info, + &settings->bools.notification_show_refresh_rate, + MENU_ENUM_LABEL_NOTIFICATION_SHOW_REFRESH_RATE, + MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_REFRESH_RATE, + DEFAULT_NOTIFICATION_SHOW_REFRESH_RATE, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_NONE); + END_SUB_GROUP(list, list_info, parent_group); END_GROUP(list, list_info, parent_group); break; diff --git a/msg_hash.h b/msg_hash.h index dc358cd250..1a39756a4b 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -2712,6 +2712,8 @@ enum msg_hash_enums MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_SCREENSHOT_FLASH_NORMAL, MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_SCREENSHOT_FLASH_FAST, + MENU_LABEL(NOTIFICATION_SHOW_REFRESH_RATE), + MENU_LABEL(SELECT_FILE), MENU_LABEL(SELECT_FROM_PLAYLIST), diff --git a/retroarch.c b/retroarch.c index b6d92266c0..f066cd56d1 100644 --- a/retroarch.c +++ b/retroarch.c @@ -30058,8 +30058,9 @@ void video_monitor_set_refresh_rate(float hz) snprintf(msg, sizeof(msg), "Setting refresh rate to: %.3f Hz.", hz); - runloop_msg_queue_push(msg, 1, 180, false, NULL, - MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); + if (settings->bools.notification_show_refresh_rate) + runloop_msg_queue_push(msg, 1, 180, false, NULL, + MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); RARCH_LOG("%s\n", msg); configuration_set_float(settings, diff --git a/ui/drivers/qt/options/osd.cpp b/ui/drivers/qt/options/osd.cpp index 23895e1977..c9fccf6f71 100644 --- a/ui/drivers/qt/options/osd.cpp +++ b/ui/drivers/qt/options/osd.cpp @@ -69,6 +69,7 @@ QWidget *NotificationsPage::widget() notificationsGroup->add(MENU_ENUM_LABEL_NOTIFICATION_SHOW_SCREENSHOT); notificationsGroup->add(MENU_ENUM_LABEL_NOTIFICATION_SHOW_SCREENSHOT_DURATION); notificationsGroup->add(MENU_ENUM_LABEL_NOTIFICATION_SHOW_SCREENSHOT_FLASH); + notificationsGroup->add(MENU_ENUM_LABEL_NOTIFICATION_SHOW_REFRESH_RATE); layout->addWidget(notificationsGroup);