flipperzero-firmware_official_dev 785 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. commit 50ef5deefc2f6b4dc1a5c89432e7a03094e9ba7d
  2. Author: Astra <93453568+Astrrra@users.noreply.github.com>
  3. Date: Thu Mar 9 10:24:47 2023 +0200
  4. [FL-3118] Dumb mode menu freeze fix (#2456)
  5. Co-authored-by: あく <alleteam@gmail.com>
  6. diff --git a/applications/services/desktop/desktop.c b/applications/services/desktop/desktop.c
  7. index f8716e6cb..556f42333 100644
  8. --- a/applications/services/desktop/desktop.c
  9. +++ b/applications/services/desktop/desktop.c
  10. @@ -144,11 +144,13 @@ void desktop_unlock(Desktop* desktop) {
  11. }
  12. void desktop_set_dummy_mode_state(Desktop* desktop, bool enabled) {
  13. + desktop->in_transition = true;
  14. view_port_enabled_set(desktop->dummy_mode_icon_viewport, enabled);
  15. desktop_main_set_dummy_mode_state(desktop->main_view, enabled);
  16. animation_manager_set_dummy_mode_state(desktop->animation_manager, enabled);
  17. desktop->settings.dummy_mode = enabled;
  18. DESKTOP_SETTINGS_SAVE(&desktop->settings);
  19. + desktop->in_transition = false;
  20. }
  21. Desktop* desktop_alloc() {
  22. diff --git a/applications/services/desktop/desktop_i.h b/applications/services/desktop/desktop_i.h
  23. index 8034bbc3a..2f3ec9b51 100644
  24. --- a/applications/services/desktop/desktop_i.h
  25. +++ b/applications/services/desktop/desktop_i.h
  26. @@ -69,6 +69,8 @@ struct Desktop {
  27. FuriPubSub* input_events_pubsub;
  28. FuriPubSubSubscription* input_events_subscription;
  29. FuriTimer* auto_lock_timer;
  30. +
  31. + bool in_transition;
  32. };
  33. Desktop* desktop_alloc();
  34. diff --git a/applications/services/desktop/scenes/desktop_scene_main.c b/applications/services/desktop/scenes/desktop_scene_main.c
  35. index b02958b66..4d1fa4950 100644
  36. --- a/applications/services/desktop/scenes/desktop_scene_main.c
  37. +++ b/applications/services/desktop/scenes/desktop_scene_main.c
  38. @@ -79,6 +79,7 @@ static void desktop_scene_main_open_app_or_profile(Desktop* desktop, const char*
  39. void desktop_scene_main_callback(DesktopEvent event, void* context) {
  40. Desktop* desktop = (Desktop*)context;
  41. + if(desktop->in_transition) return;
  42. view_dispatcher_send_custom_event(desktop->view_dispatcher, event);
  43. }