InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.63k stars 902 forks source link

DisplayApp: Go to clock on wakeup if no app loaded #1980

Open vkareh opened 5 months ago

vkareh commented 5 months ago

When waking the screen up, if there is no actual app loaded (i.e. we are still in the QuickSettings, Settings, or Launcher screens) we should just reload the Clock app directly.

github-actions[bot] commented 5 months ago
Build size and comparison to main: Section Size Difference
text 377240B 32B
data 940B 0B
bss 63556B 0B
vkareh commented 5 months ago

This supercedes https://github.com/InfiniTimeOrg/InfiniTime/pull/1436 since that one has conflicts and uses outdated function calls.

mark9064 commented 5 months ago

Future compatibility thought: with always on display (#1869), it'd be preferred if the app was loaded on sleep entry rather than on wake. But the whole sleep state might end up being refactored anyway so if this is annoying to implement then don't worry

vkareh commented 5 months ago

@mark9064 - that's a good point. I tried it on sleep and it works even better (the transition is less choppy). Thanks for the suggestion!

Regarding future refactor, I feel that this is a simple enough change and can be moved around as needed without much overhead.

mark9064 commented 5 months ago

Great to hear it's working even better. To clarify what I meant originally: "as part of 1869, we might have to refactor some sleep stuff so if it's difficult to change this PR to work on sleep entry at the moment then don't worry". But you've managed to work it out anyway, so it doesn't matter :+1:

JustScott commented 5 months ago

Finding this quite nice as I consistently forget to return to the watch face. I'm wondering what thoughts are on having this also apply to the notifications, as that isn't an app that really needs to stay open after you view it once.

vkareh commented 5 months ago

@JustScott at first I assumed that this wouldn't be necessary for the Notifications screen as I usually just dismiss notifications fairly quickly after viewing them, but then realized I use https://github.com/InfiniTimeOrg/InfiniTime/pull/1716 as part of my daily driver branch, so it's a bit less relevant.

However, after testing it some more, I think it makes sense to add Notifications to the list. It works well with it, so I've pushed a new change.

mark9064 commented 2 months ago

Works great, don't find my watch on random screens where it has clicked itself nearly so often as all of the screens one swipe away now return back to the watchface safely. Integrates with AOD perfectly as well.