Skip to content

Fix night mode and OSD recovery after suspend/resume#2254

Merged
bbedward merged 1 commit intoAvengeMedia:masterfrom
kristijanribaric:fix/resume-night-mode-osd-recovery
Apr 22, 2026
Merged

Fix night mode and OSD recovery after suspend/resume#2254
bbedward merged 1 commit intoAvengeMedia:masterfrom
kristijanribaric:fix/resume-night-mode-osd-recovery

Conversation

@kristijanribaric
Copy link
Copy Markdown
Contributor

Fixes #424

Summary

Fix suspend/resume recovery in Quickshell so that:

  • night mode / blue light filtering is restored after resume
  • OSDs render correctly again after resume
  • theme automation can refresh on unlock/resume

What changed

quickshell/Services/SessionService.qml

  • subscribe to logind PrepareForSleep over DBus
  • emit a dedicated sessionResumed signal when sleep ends
  • deduplicate resume emission to avoid duplicate recovery work

quickshell/Services/DisplayService.qml

  • listen for SessionService.sessionResumed
  • re-check gamma availability after resume
  • rescan brightness devices after resume
  • re-run night mode recovery with delayed retry passes
  • suppress OSD briefly during resume recovery

quickshell/DMSShell.qml

  • recreate OSD layer-shell surfaces after resume
  • reload OSD surfaces through a loader so stale surfaces are torn down cleanly
  • retry OSD surface recreation to handle delayed compositor recovery

quickshell/Common/Theme.qml

  • refresh theme automation on unlock/resume via SessionService
  • keep a fallback unlock refresh path when direct loginctl integration is used differently

Why

After suspend/resume, some session state comes back asynchronously:

  • gamma/night mode backends may not be ready immediately
  • layer-shell surfaces used by OSD windows may become stale and stop rendering

This change makes resume recovery explicit and retries it with small delays so the shell can recover reliably.

Manual testing

Tested on CachyOS with Niri

Tested manually by:

  1. starting the shell normally
  2. enabling blue light / night mode
  3. suspending the session
  4. resuming the session
  5. verifying:
    • blue light filter is restored
    • OSD appears again when changing brightness/volume

Notes

Made with the help of GPT-5.4 as I am not that proficient with Qt, please review thoroughly.

@bbedward bbedward merged commit b87c36d into AvengeMedia:master Apr 22, 2026
1 check passed
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.

Volume and Brightness OSD not visible after return from suspension

2 participants