From 3fa1052dad8872a16aa1f92dad439cbbcb0ee038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kelemen=20=28vudiq=29?= Date: Wed, 17 Nov 2021 17:31:24 +0100 Subject: [PATCH] Honor config_save_on_exit when Reboot/Shutdown is called When Shutdown or Reboot are selected from the main menu, configuration is saved regardless of checking the user setting. Showing the widget and saving the configuration should be called only in case user wants to save configuration on exit. --- retroarch.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/retroarch.c b/retroarch.c index 5434854ab4..18ba465cf8 100644 --- a/retroarch.c +++ b/retroarch.c @@ -4722,16 +4722,22 @@ bool command_event(enum event_command cmd, void *data) break; case CMD_EVENT_SHUTDOWN: #if defined(__linux__) && !defined(ANDROID) - runloop_msg_queue_push(msg_hash_to_str(MSG_VALUE_SHUTTING_DOWN), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); - command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL); + if (settings->bools.config_save_on_exit) + { + runloop_msg_queue_push(msg_hash_to_str(MSG_VALUE_SHUTTING_DOWN), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); + command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL); + } command_event(CMD_EVENT_QUIT, NULL); system("shutdown -P now"); #endif break; case CMD_EVENT_REBOOT: #if defined(__linux__) && !defined(ANDROID) - runloop_msg_queue_push(msg_hash_to_str(MSG_VALUE_REBOOTING), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); - command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL); + if (settings->bools.config_save_on_exit) + { + runloop_msg_queue_push(msg_hash_to_str(MSG_VALUE_REBOOTING), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO); + command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL); + } command_event(CMD_EVENT_QUIT, NULL); system("shutdown -r now"); #endif