Skip to content

compositor: Turn off display in non-ambient mode when display goes Off (fixes #198) - #236

Open
NickASanOS wants to merge 1 commit into
AsteroidOS:masterfrom
NickASanOS:fix/display-off-non-ambient
Open

NickASanOS wants to merge 1 commit into
AsteroidOS:masterfrom
NickASanOS:fix/display-off-non-ambient

Conversation

@NickASanOS

Copy link
Copy Markdown

When ambient/AOD is disabled and the display goes Off (power button press while an app is open), the compositor window was never hidden because the ambient-only code path never triggered.

Root cause

In LipstickCompositor::reactOnDisplayStateChanges, when display goes Off and ambient is disabled, only displayOff() was emitted. The window stayed visible indefinitely — delayTimer fired after 5 seconds but setAmbientUpdatesEnabled(true) returned immediately because !ambientEnabled().

Changes

  • lipstick core: Immediately call setUpdatesEnabled(false) when display goes Off in non-ambient mode. On wake-up, call setUpdatesEnabled(true) for proper restoration (DisplayOn, displayAboutToBeOn).
  • asteroid-launcher QML: Only start delayTimer when ambient is enabled. Non-ambient display-off is now handled in C++.

Fixes #198

Only start the 5-second delayTimer when ambient/AOD is enabled.
In non-ambient mode, display-off handling is done immediately in
LipstickCompositor::reactOnDisplayStateChanges.

Refs AsteroidOS#198
@FlorentRevest

Copy link
Copy Markdown
Member

Is this necessary in addition to AsteroidOS/lipstick#24 or is only one or the other required ?

@MagneFire

Copy link
Copy Markdown
Member

This PR appears to depend on #235. Keeping this as a note here

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.

Screen stays on when putting watch to sleep while an app is open

3 participants