diff --git a/applications/services/desktop/desktop.h b/applications/services/desktop/desktop.h index 9768a59cf..e83bc3ee4 100644 --- a/applications/services/desktop/desktop.h +++ b/applications/services/desktop/desktop.h @@ -1,7 +1,6 @@ #pragma once #include -#include #include "desktop_settings.h" diff --git a/applications/services/desktop/desktop_keybinds.c b/applications/services/desktop/desktop_keybinds.c index bbb1f4c13..60c60b7e5 100644 --- a/applications/services/desktop/desktop_keybinds.c +++ b/applications/services/desktop/desktop_keybinds.c @@ -109,7 +109,12 @@ static FuriString* void desktop_keybinds_load(Desktop* desktop, DesktopKeybinds* keybinds) { for(DesktopKeybindType type = 0; type < DesktopKeybindTypeMAX; type++) { for(DesktopKeybindKey key = 0; key < DesktopKeybindKeyMAX; key++) { - (*keybinds)[type][key] = furi_string_alloc_set(desktop_keybinds_defaults[type][key]); + const char* default_keybind = desktop_keybinds_defaults[type][key]; + if((*keybinds)[type][key]) { + furi_string_set((*keybinds)[type][key], default_keybind); + } else { + (*keybinds)[type][key] = furi_string_alloc_set(default_keybind); + } } } diff --git a/applications/services/desktop/desktop_keybinds.h b/applications/services/desktop/desktop_keybinds.h index dfc54f054..b0e09bc76 100644 --- a/applications/services/desktop/desktop_keybinds.h +++ b/applications/services/desktop/desktop_keybinds.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include "desktop.h" diff --git a/applications/settings/desktop_settings/scenes/desktop_settings_scene_keybinds_reset.c b/applications/settings/desktop_settings/scenes/desktop_settings_scene_keybinds_reset.c index 4acf9daf9..ed91bb05c 100644 --- a/applications/settings/desktop_settings/scenes/desktop_settings_scene_keybinds_reset.c +++ b/applications/settings/desktop_settings/scenes/desktop_settings_scene_keybinds_reset.c @@ -33,7 +33,6 @@ bool desktop_settings_scene_keybinds_reset_on_event(void* context, SceneManagerE case DialogExResultRight: storage_common_remove(furi_record_open(RECORD_STORAGE), DESKTOP_KEYBINDS_PATH); furi_record_close(RECORD_STORAGE); - desktop_keybinds_free(&app->keybinds); desktop_keybinds_load(furi_record_open(RECORD_DESKTOP), &app->keybinds); furi_record_close(RECORD_DESKTOP); app->save_keybinds = false;