Skip to content

screensaver: close open shell panels before launching - #15657

Closed
AnPod wants to merge 1 commit into
omacom:quattrofrom
AnPod:screensaver-hide-open-panels
Closed

AnPod wants to merge 1 commit into
omacom:quattrofrom
AnPod:screensaver-hide-open-panels

Conversation

@AnPod

@AnPod AnPod commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

If a panel built on shell/Ui/KeyboardPanel.qml is open when the screensaver starts (the bar calendar omarchy.clock, the clipboard or emoji picker), the screensaver window never goes fullscreen and closes itself about a second later (#15643). Those panels are overlay layer surfaces that hold keyboard focus while open, so the screensaver terminals map unfocused and their fullscreen window rule never applies.

Fix

  • shell.qml gains hideOpenPanels(): hides every panel the shell reports open and returns the ids it closed.
  • The shell IPC target exposes hideOpenPanels, so scripts can close all panels in one call.
  • omarchy-launch-screensaver calls omarchy-shell -q shell hideOpenPanels before capturing focus and spawning the terminals. -q keeps it best effort: no running shell must not block the screensaver.

Test

New test/shell.d/screensaver-hide-open-panels-test.sh:

  • a stubbed omarchy-shell records the IPC call — the launcher must issue shell hideOpenPanels before the first screensaver terminal is spawned (fails on quattro: no such call);
  • the QML function is extracted and run under node: it attempts hide on every open panel, reports only the ones closed, and the IPC target exposes it.

Verified the test fails without the fix (git stash of both changed files) and passes with it. Related existing tests pass: screensaver-workspace-test.sh, idle-test.sh, system-lock-test.sh.

Fixes #15643

Also fixes #6917 and #13265 (per paulogeyer review: same root cause - a hidden screensaver window is re-shown instead of a fresh launch).

An open panel built on KeyboardPanel (clock, clipboard, emoji picker) is an
overlay layer surface that holds keyboard focus while it is up, so the
screensaver terminals map unfocused and their fullscreen window rule never
applies: the screensaver opens at its fallback size and gives up.

omarchy-launch-screensaver now asks the shell, over IPC, to close every open
panel before spawning the terminals. The new shell.hideOpenPanels() walks the
panel loaders and hides each one the shell reports open.

Fixes omacom#15643
@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Low impact] The change stays within screensaver startup and shell-panel control.

Fix the missing bar-widget coverage before merging; an open clock calendar still blocks the screensaver.

Findings

  1. P1 Clock calendar stays open ▶
  2. P2 Test cannot prove event order ▶

Summary

Adds hideOpenPanels() and calls it before starting screensaver terminals.

  • The screensaver closes open shell panels before starting terminals.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Start screensaver] --> B[Call hideOpenPanels]
  B --> C[Close panels in panelLoaders]
  B -. skips .-> D[Clock calendar in the bar]
  C --> E[Start terminals]
  D --> F[Calendar keeps keyboard focus]
Loading

Reviews (1) · Last reviewed commit: "screensaver: close open shell panels bef..." · Reviewed by Greptile

Comment thread shell/shell.qml
Comment on lines +1283 to +1284
for (var id in panelLoaders) {
if (shell.isPluginOpen(id) && shell.hide(id)) closed.push(id)

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.

P1 Clock calendar stays open

hideOpenPanels() only walks panelLoaders, but omarchy.clock is a bar-widget whose calendar is tracked and closed through the bar. If the calendar is open, this call leaves its KeyboardPanel holding focus. The screensaver still fails to fill the screen and closes shortly afterward.

Include open bar-widget panels too. The new test masks this gap by putting omarchy.clock in a fake panelLoaders map.

Knowledge Base Used: Shell UI and desktop interactions

Comment on lines +68 to +71
ipc_line=$(grep -nE '(^| )shell hideOpenPanels$' "$tmpdir/ipc" | head -1 | cut -d: -f1)
spawn_line=$(grep -n 'exec_cmd' "$tmpdir/calls" | head -1 | cut -d: -f1)
[[ -n $spawn_line ]] || fail "the screensaver was spawned" "$(cat "$tmpdir/calls")"
(( ipc_line <= spawn_line )) ||

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.

P2 Test cannot prove event order

ipc_line comes from ipc, while spawn_line comes from calls. Line numbers from separate files cannot show which event happened first. Moving the close call after terminal creation would still pass, so this test misses the timing regression it is meant to catch. Record both events in one log and compare their positions there.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@paulogeyer

Copy link
Copy Markdown
Contributor

I reviewed the open PRs for the screensaver opening small and exiting when a bar panel is open (#6917, #13265, #15643, plus #8291, which is closed). This is code review only: reproducing it would mean launching the real screensaver.

PR approach merges cleanly / commits behind
#15657 closes open shell panels before launching yes / 0
#13784 Hyprland rule focuses and fullscreens the screensaver on open yes / 371
#13475 closes panels and adds a focus grace period yes / 371
#7102, #13637, #12258 stop the focus check from exiting until the screensaver has had focus yes

The cause is the one #13784 and #15657 describe: an open panel is a layer surface holding keyboard focus, so the screensaver maps unfocused and its fullscreen rule never applies. #7102, #13637 and #12258 stop the immediate exit, but the screensaver still stays a small unfocused window. A screensaver that only leaves on a later focus change also fits #12225.

I'd go with #15657. It removes the cause before launching, is level with quattro, CI is green, and it reuses the shell's own hide path. #13475 duplicates it. #7102, #13637 and #12258 work around the symptom instead of fixing it.

Suggestion for #15657: also add Fixes #6917 and Fixes #13265.

#13784 is a reasonable follow-up for layer surfaces the shell doesn't own (such as other launchers). #11239 is a separate fix for a panel drawn over a running screensaver (#11234), not a duplicate.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for this. I read the diff at b354555 and classified it as a bug fix (Claude Opus 5.5), but I could not get the second classification this queue needs before it reviews anything: the reviewer (Codex Medium) is up, but today's reviewer budget was already used. Without two classifications I have added no label, run nothing on a worker and verified nothing, so this comment makes no claim about whether the fix works.

Next: this pull request stays in the queue with its classification unsettled. A later pass settles the classification, and then it gets the full review: a reproduction on a worker, the test suite, and a second opinion. Nothing is needed from you in the meantime.

AnPod commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Closing since the linked issue #15643 was closed.

@AnPod AnPod closed this Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants