Skip to content

Switch to home screen immediately when entering AOD/ambient mode (fixes meta-asteroid#228)#235

Open
NickASanOS wants to merge 1 commit into
AsteroidOS:2.0from
NickASanOS:fix/aod-shows-app-instead-of-watchface
Open

Switch to home screen immediately when entering AOD/ambient mode (fixes meta-asteroid#228)#235
NickASanOS wants to merge 1 commit into
AsteroidOS:2.0from
NickASanOS:fix/aod-shows-app-instead-of-watchface

Conversation

@NickASanOS

Copy link
Copy Markdown

When AOD (Always-On Display) activates while an application is open, the
compositor previously kept showing the dimmed application for 5 seconds
until delayTimer fired, killed the app, and switched to the home screen.

During those 5 seconds the dimmed app was visible instead of the
AOD-optimized watchface. This was reported as
AsteroidOS/meta-asteroid#228.

Changes

  • Added onDisplayAmbientEntered handler: immediately switches to the home
    window when ambient mode activates, saving a reference to the app
  • Modified delayTimer: kills the saved app reference instead of the
    current topmost window (which is now the home window)
  • Updated onDisplayAboutToBeOn: restores the saved app if the display
    wakes before the 5-second cleanup timer fires (but not during periodic
    ambient minute updates)
  • Added onWindowRemoved safety check: clears the saved app reference if
    the app is closed externally while in ambient mode

Fixes AsteroidOS/meta-asteroid#228

When AOD activates with an app open, the compositor previously showed the
dimmed app for 5 seconds until delayTimer killed the app and switched to
the home screen. During that window the watchface's AOD-optimized display
was never shown.

Now on displayAmbientEntered, the compositor immediately switches to the
home window (showing the AOD watchface). The app is preserved for
restoration if the display wakes before the 5-second cleanup timer fires.

Fixes AsteroidOS/meta-asteroid#228
@MagneFire

Copy link
Copy Markdown
Member

Thank you for working on this!

This doesn't seem to work correctly.

When the display transitions to AOD mode the app is now correctly hidden, but upon display awake the app does not appear to be restored.
My guess is that this occurs because !Lipstick.compositor.displayAmbient doesn't evaluate to true.
There's also another issue where the onDisplayAboutToBeOn doesn't get fired if you quickly tap the power button.

Another question, how does this PR relate to https://github.com/AsteroidOS/asteroid-launcher/pull/236/changes and https://github.com/AsteroidOS/lipstick/pull/24/changes? They both appear to attempt to solve the same issue (meta-asteroid#228 and #198 refer to the same issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants