From 1d0df29b2c783f746c3e66dcaa92afd3ca1357fd 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 394a3239..bb6d31a0 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -303,6 +303,11 @@ void DisplayApp::Refresh() { } else { brightnessController.Set(Controllers::BrightnessController::Levels::Off); 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;