From 5e8a4194c9e07390546f7e9cebb457485566c133 Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Thu, 18 Jan 2024 16:08:49 -0500 Subject: [PATCH] DisplayApp: Go to clock on sleep if no app loaded When turning off the screen, if there is no actual app loaded (i.e. we are still in the Launcher, Notifications, QuickSettings, or Settings screens) we should just reload the Clock app directly. --- src/displayapp/DisplayApp.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 938d1179a8..f04cef2ce8 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -244,6 +244,11 @@ void DisplayApp::Refresh() { vTaskDelay(100); } lcd.Sleep(); + // Since the active screen is not really an app, go back to Clock. + if (currentApp == Apps::Launcher || currentApp == Apps::Notifications || currentApp == Apps::QuickSettings || + currentApp == Apps::Settings) { + LoadScreen(Apps::Clock, DisplayApp::FullRefreshDirections::None); + } PushMessageToSystemTask(Pinetime::System::Messages::OnDisplayTaskSleeping); state = States::Idle; break;