From 50ef5deefc2f6b4dc1a5c89432e7a03094e9ba7d Mon Sep 17 00:00:00 2001 From: Astra <93453568+Astrrra@users.noreply.github.com> Date: Thu, 9 Mar 2023 10:24:47 +0200 Subject: [PATCH] [FL-3118] Dumb mode menu freeze fix (#2456) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: あく --- applications/services/desktop/desktop.c | 2 ++ applications/services/desktop/desktop_i.h | 2 ++ applications/services/desktop/scenes/desktop_scene_main.c | 1 + 3 files changed, 5 insertions(+) diff --git a/applications/services/desktop/desktop.c b/applications/services/desktop/desktop.c index f8716e6cb..556f42333 100644 --- a/applications/services/desktop/desktop.c +++ b/applications/services/desktop/desktop.c @@ -144,11 +144,13 @@ void desktop_unlock(Desktop* desktop) { } void desktop_set_dummy_mode_state(Desktop* desktop, bool enabled) { + desktop->in_transition = true; view_port_enabled_set(desktop->dummy_mode_icon_viewport, enabled); desktop_main_set_dummy_mode_state(desktop->main_view, enabled); animation_manager_set_dummy_mode_state(desktop->animation_manager, enabled); desktop->settings.dummy_mode = enabled; DESKTOP_SETTINGS_SAVE(&desktop->settings); + desktop->in_transition = false; } Desktop* desktop_alloc() { diff --git a/applications/services/desktop/desktop_i.h b/applications/services/desktop/desktop_i.h index 8034bbc3a..2f3ec9b51 100644 --- a/applications/services/desktop/desktop_i.h +++ b/applications/services/desktop/desktop_i.h @@ -69,6 +69,8 @@ struct Desktop { FuriPubSub* input_events_pubsub; FuriPubSubSubscription* input_events_subscription; FuriTimer* auto_lock_timer; + + bool in_transition; }; Desktop* desktop_alloc(); diff --git a/applications/services/desktop/scenes/desktop_scene_main.c b/applications/services/desktop/scenes/desktop_scene_main.c index b02958b66..4d1fa4950 100644 --- a/applications/services/desktop/scenes/desktop_scene_main.c +++ b/applications/services/desktop/scenes/desktop_scene_main.c @@ -79,6 +79,7 @@ static void desktop_scene_main_open_app_or_profile(Desktop* desktop, const char* void desktop_scene_main_callback(DesktopEvent event, void* context) { Desktop* desktop = (Desktop*)context; + if(desktop->in_transition) return; view_dispatcher_send_custom_event(desktop->view_dispatcher, event); }