InfiniTime icon indicating copy to clipboard operation
InfiniTime copied to clipboard

ApplicationList: Reset app menu screen when loading watch face

Open vkareh opened this issue 1 year ago • 4 comments

This prevents the application list from loading in the last used screen and instead goes back to the first screen whenever the watch face is loaded.

Fixes #2006

vkareh avatar Feb 09 '24 13:02 vkareh

Build size and comparison to main:

Section Size Difference
text 377096B 16B
data 940B 0B
bss 63516B 0B

github-actions[bot] avatar Feb 09 '24 13:02 github-actions[bot]

Have you checked why the page number of the launcher is actually stored? I wouldn't want to apply a change that conflicts with the original intend of the code.

I think it would also be a good idea to check that the behavior reported in #2006 does not happen for other apps as well, like settings for example (that you can open with a double press on the button iirc)? Maybe the fix should be more generic than it currently is?

JF002 avatar Feb 11 '24 12:02 JF002

Have you checked why the page number of the launcher is actually stored? I wouldn't want to apply a change that conflicts with the original intend of the code.

Yes. It was added as part of #217 with the description:

  • Go back to the same menu page when we leave an app

This behaviour is preserved, as we only reset the page when we're not in an app.

I think it would also be a good idea to check that the behavior reported in https://github.com/InfiniTimeOrg/InfiniTime/issues/2006 does not happen for other apps as well, like settings for example (that you can open with a double press on the button iirc)? Maybe the fix should be more generic than it currently is?

This issue doesn't happen in the settings, since we don't store the current screen there.

vkareh avatar Feb 12 '24 15:02 vkareh

Git bisect says the bug was introduced in 39bc166e549e8ccae75468aa2dd3613d51f54e27. There was no call to SetAppMenu removed in that commit... Why didn't the bug occur before?

FintasticMan avatar Feb 14 '24 19:02 FintasticMan

Git bisect says the bug was introduced in https://github.com/InfiniTimeOrg/InfiniTime/commit/39bc166e549e8ccae75468aa2dd3613d51f54e27. There was no call to SetAppMenu removed in that commit... Why didn't the bug occur before?

The call to Settings::SetAppMenu() was done in the ctor of the Clock class, which was removed in this https://github.com/InfiniTimeOrg/InfiniTime/commit/39bc166e549e8ccae75468aa2dd3613d51f54e27 commit!

And I think the @vkareh found a better place for this in DisplayApp so that watch faces do not have to manage this state.

JF002 avatar Mar 12 '24 20:03 JF002