From f83ec0562c7f2c6d3c72dc7c77e9af4b10c58a46 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 d9b2e9b3ab..6f3fe76daa 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -243,6 +243,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;