mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 16:48:35 -07:00
@@ -34,10 +34,8 @@ static void desktop_loader_callback(const void* message, void* context) {
|
|||||||
const LoaderEvent* event = message;
|
const LoaderEvent* event = message;
|
||||||
|
|
||||||
if(event->type == LoaderEventTypeApplicationBeforeLoad) {
|
if(event->type == LoaderEventTypeApplicationBeforeLoad) {
|
||||||
desktop->animation_lock = api_lock_alloc_locked();
|
|
||||||
view_dispatcher_send_custom_event(desktop->view_dispatcher, DesktopGlobalBeforeAppStarted);
|
view_dispatcher_send_custom_event(desktop->view_dispatcher, DesktopGlobalBeforeAppStarted);
|
||||||
api_lock_wait_unlock_and_free(desktop->animation_lock);
|
furi_check(furi_semaphore_acquire(desktop->animation_semaphore, 3000) == FuriStatusOk);
|
||||||
desktop->animation_lock = NULL;
|
|
||||||
} else if(
|
} else if(
|
||||||
event->type == LoaderEventTypeApplicationLoadFailed ||
|
event->type == LoaderEventTypeApplicationLoadFailed ||
|
||||||
event->type == LoaderEventTypeApplicationStopped) {
|
event->type == LoaderEventTypeApplicationStopped) {
|
||||||
@@ -125,7 +123,7 @@ static bool desktop_custom_event_callback(void* context, uint32_t event) {
|
|||||||
animation_manager_unload_and_stall_animation(desktop->animation_manager);
|
animation_manager_unload_and_stall_animation(desktop->animation_manager);
|
||||||
}
|
}
|
||||||
desktop_auto_lock_inhibit(desktop);
|
desktop_auto_lock_inhibit(desktop);
|
||||||
api_lock_unlock(desktop->animation_lock);
|
furi_semaphore_release(desktop->animation_semaphore);
|
||||||
return true;
|
return true;
|
||||||
case DesktopGlobalAfterAppFinished:
|
case DesktopGlobalAfterAppFinished:
|
||||||
animation_manager_load_and_continue_animation(desktop->animation_manager);
|
animation_manager_load_and_continue_animation(desktop->animation_manager);
|
||||||
@@ -282,6 +280,7 @@ void desktop_set_stealth_mode_state(Desktop* desktop, bool enabled) {
|
|||||||
Desktop* desktop_alloc(void) {
|
Desktop* desktop_alloc(void) {
|
||||||
Desktop* desktop = malloc(sizeof(Desktop));
|
Desktop* desktop = malloc(sizeof(Desktop));
|
||||||
|
|
||||||
|
desktop->animation_semaphore = furi_semaphore_alloc(1, 0);
|
||||||
desktop->animation_manager = animation_manager_alloc();
|
desktop->animation_manager = animation_manager_alloc();
|
||||||
desktop->gui = furi_record_open(RECORD_GUI);
|
desktop->gui = furi_record_open(RECORD_GUI);
|
||||||
desktop->scene_thread = furi_thread_alloc();
|
desktop->scene_thread = furi_thread_alloc();
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
#include <loader/loader.h>
|
#include <loader/loader.h>
|
||||||
#include <notification/notification_app.h>
|
#include <notification/notification_app.h>
|
||||||
#include <toolbox/api_lock.h>
|
|
||||||
|
|
||||||
#define STATUS_BAR_Y_SHIFT 13
|
#define STATUS_BAR_Y_SHIFT 13
|
||||||
|
|
||||||
@@ -81,7 +80,7 @@ struct Desktop {
|
|||||||
|
|
||||||
bool in_transition : 1;
|
bool in_transition : 1;
|
||||||
|
|
||||||
FuriApiLock animation_lock;
|
FuriSemaphore* animation_semaphore;
|
||||||
|
|
||||||
Keybinds keybinds;
|
Keybinds keybinds;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user