From eac181b59262bfdf7c294a4e7452e56fbe43bb5e 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 9c7d87b2b8..f0a4dc72f2 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -246,6 +246,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;