Skip to content

Fade the lock screen in and out over the live desktop - #13962

Open
cb2206 wants to merge 4 commits into
omacom:quattrofrom
cb2206:lock-fade-over-desktop
Open

cb2206 wants to merge 4 commits into
omacom:quattrofrom
cb2206:lock-fade-over-desktop

Conversation

@cb2206

@cb2206 cb2206 commented Oct 1, 2026 •

Copy link
Copy Markdown

Summary

Split out of #13918 at review, so the fade can be judged on its own. It is independent of #13918 and based on quattro. Both PRs touch shell/plugins/lock/, so whichever merges second needs a small rebase.

The lock currently cuts straight from the desktop to the lock screen and back. This fades it in and out over the live desktop instead.

Hyprland's misc:session_lock_xray keeps the workspaces rendering underneath the lock. It is switched on at runtime (hyprctl eval) only around a transition, and a config reload restores the configured value.

  • Lock: the lock surface comes up transparent over the desktop and fades in as soon as the session lock is secure. The wallpaper blurs in as it decodes, and xray goes off once every screen's lock is opaque.
  • Unlock: after a successful authentication the view fades out to the desktop. Then the session lock is released and xray goes off.

The desktop can only show through while xray is on and the lock surface is transparent. Both are tied to these transitions:

  • Suspend: status() doesn't report the lock secure until the fade-in is opaque on every screen. omarchy-system-sleep-lock waits on that flag, so a suspend never catches the lock see-through. A fade-in that never reports back is forced opaque after 1 s. It isn't reported secure during the unlock fade either, so an authentication just as the lid closes makes the helper wait for the unlock and lock again.
  • Input: the session lock is held for the whole fade, so input never reaches the desktop.
  • Late confirmation: a lock surface created before Hyprland confirmed xray comes up opaque, as today.
  • Lock request mid-unlock: a lock request during the unlock fade cancels it. The view snaps opaque, xray goes off and authentication restarts.
  • New locks: every new lock starts opaque, and there's no fade while the display is blank.
  • hyprctl failure: the unlock falls back to fading to the wallpaper. A failed request to turn xray off is retried up to three times.

Most of the LockView diff is indentation from wrapping the lock content in one item that fades and scales. It reads best with whitespace hidden (?w=1).

The review threads on this code in #13918 (live desktop during the lock fade-in, second monitor, unlock fallback) were resolved there. This PR carries those fixes.

Testing

  • Hardware: used daily on an M1 MacBook Pro running the omarchy-mac 4.0.3 lock plugin. Lock, unlock (Touch ID and password), lid close and suspend were all checked. In the journal, the lock reported opaque about 0.64 s after Hyprland confirmed it, and user.slice froze about 95 ms after that.
  • On quattro: both files compile in Quickshell, and the lock, sleep, polkit and runtime-smoke suites under test/shell.d pass. I haven't run the quattro version live, since my machine runs the omarchy-mac package.
  • New tests: lock-desktop-fade-test.sh covers the fade state logic against mocks: the unlock fade, cancelling it, the blank display, the secure flag, the fallback, and multiple screens.

Turn on Hyprland's session_lock_xray only around lock and unlock so the
lock cross-fades with the desktop. The lock is not reported secure until
the fade-in is opaque, so a suspend never catches it see-through.
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adds fade animations to the lock screen transitions.

The PR appears safe to merge based on the reviewed changes and resolved prior findings.

Summary

The PR fades the lock surface over the live desktop while retaining the session lock through both transitions. Since the previous review, it also stops a pending xray-off retry when a new fade begins and guards the retry when it fires.

  • The previous secure-status and xray-cleanup findings are fixed in the current code.
  • The previously reported stale-retry interruption is fixed; no new actionable issue was established.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Lock requested] --> B[Xray confirmed]
  B --> C[Lock surfaces fade in]
  C --> D[Opaque on every screen]
  D --> E[Xray off]
  E --> F[Authentication succeeds]
  F --> G[Xray confirmed]
  G --> H[Lock view fades out]
  H --> I[Session lock released]
  I --> J[Xray off]
Loading

Reviews (3) · Last reviewed commit: "Don't let a pending xray-off retry cut a..."

Comment thread shell/plugins/lock/Service.qml Resolved
Comment thread shell/plugins/lock/Service.qml Resolved
cb2206 added 2 commits October 1, 2026 10:48
The sleep path suspends once status() says secure. During the unlock fade the
session lock is still held while the view is turning see-through, so an
authentication just as the lid closed could suspend over the desktop. It
now waits for the unlock to finish and locks again.
Left on, Hyprland keeps rendering the desktop under every later lock. The
lock stays opaque, so nothing shows, but it is wasted work for as long as the
screen is locked. Retry up to three times, unless xray is wanted again.
Comment thread shell/plugins/lock/Service.qml Resolved
Turning xray back on for a lock or unlock fade now cancels any retry left
from a failed xray-off, and the retry itself bails out while a fade needs
the desktop rendered under the lock.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants