Skip to content

Make the screensaver engage properly when idle - #8738

Closed
pablohc wants to merge 2 commits into
omacom:quattrofrom
pablohc:fix-screensaver-focus-restore
Closed

Make the screensaver engage properly when idle#8738
pablohc wants to merge 2 commits into
omacom:quattrofrom
pablohc:fix-screensaver-focus-restore

Conversation

@pablohc

@pablohc pablohc commented Aug 28, 2026

Copy link
Copy Markdown

What was broken

Two stacked bugs kept the screensaver from ever engaging:

  1. The screensaver always died ~1-3s after launch. omarchy-launch-screensaver ends with hypr_focus_monitor "$focused", restoring focus to the previously focused window. omarchy-screensaver exits whenever it is not the active window (hyprctl activewindow class check), so the launcher's own last line killed the screensaver it just launched — leaving a windowed flash instead of a screensaver, on every idle cycle. Because each death looked like a user dismissal, the idle service canceled the pending lock timer too, so the screen also never locked.
  2. Open bar panels kept drawing on top of the fullscreen screensaver. A popout like the battery menu is a keyboard-focused overlay layer that renders above the screensaver window, so if one was open when idle fired, its card stayed floating over the screensaver.

Fixes

Commit 1 — keep focus on the screensaver after launching it: iterate monitors with the focused one last and drop the final focus restore. The last spawned screensaver (on the user's own monitor) keeps focus, which preserves the intent of ending on the user's monitor — and since every screensaver terminal shares the org.omarchy.screensaver class, the active-window check passes for all of them.

Commit 2 — close open panels before the screensaver takes over: startIdleCycle() now closes the bar's active popout and any summoned panels (menu, emojis, clipboard, ...) before launching the screensaver, via the new IdleModel.openPanelIdsToClose helper. Each closure is logged as close-open-panel for diagnostics.

Verification

On a single-monitor (eDP-1, foot) machine:

  • Before commit 1, the screensaver window lost focus ~3s after launch and exited on every cycle; after it, it stayed active and on screen for the full 25s observation window until dismissed with a key.
  • With the battery menu open and idle firing, the menu closes (close-open-panel: bar popout in the idle journal) and the screensaver engages fullscreen with nothing drawn on top.
  • Idle-service journal on an affected machine (every cycle of the boot):
idle-cycle-start: screensaver=150 lock=300
process-start: screensaver ...
idle-cycle-cancel: screensaver-dismissed   # ~1-3s later, every time
  • test/shell.d/idle-test.sh extended with coverage for openPanelIdsToClose and passing; ./test/cli passes. Three shell-suite failures (config-test, snapper-test, unowned-system-paths-test) are pre-existing on this machine and unrelated to this change — e.g. "omarchy-pkgs checkout found for PKGBUILD coverage" fails for lack of a local checkout.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings August 28, 2026 09:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Co-Authored-By: Claude <noreply@anthropic.com>
@pablohc pablohc changed the title Keep focus on the screensaver after launching it Make the screensaver engage properly when idle Aug 28, 2026
@pablohc pablohc closed this Aug 28, 2026
@pablohc
pablohc deleted the fix-screensaver-focus-restore branch August 28, 2026 21:17
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