From bff83fe5632adc707fb5d2b0aa208bd160df0095 Mon Sep 17 00:00:00 2001 From: Dimariqe Date: Fri, 20 Mar 2026 20:29:32 +0700 Subject: [PATCH] fix: redraw wallpaper after DMS lock screen is dismissed (#2037) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After unlocking the screen (startup lock or wake from sleep), the desktop showed Hyprland's background color instead of the wallpaper. WallpaperBackground disables QML updates via updatesEnabled after a 1-second settle timer. While WlSessionLock is active, Hyprland does not composite the background layer, so when the lock is released it needs a fresh Wayland buffer — but none is committed because the render loop is already paused. The previous attempt used SessionService.sessionUnlocked, which is unreliable for the startup lock case: DMSService is not yet connected when lock() is called at startup, so notifyLoginctl is a no-op and the loginctl state never transitions, meaning sessionUnlocked never fires. Fix by tracking the shell lock state directly from Lock.qml's shouldLock via a new IdleService.isShellLocked property. WallpaperBackground watches this and re-enables rendering for 1 second on unlock, ensuring a fresh buffer is committed to Wayland before the compositor resumes displaying the layer. --- quickshell/Modules/Lock/Lock.qml | 1 + quickshell/Modules/WallpaperBackground.qml | 10 ++++++++++ quickshell/Services/IdleService.qml | 1 + 3 files changed, 12 insertions(+) diff --git a/quickshell/Modules/Lock/Lock.qml b/quickshell/Modules/Lock/Lock.qml index 5a3c6707..9a5a00fb 100644 --- a/quickshell/Modules/Lock/Lock.qml +++ b/quickshell/Modules/Lock/Lock.qml @@ -14,6 +14,7 @@ Scope { property bool shouldLock: false onShouldLockChanged: { + IdleService.isShellLocked = shouldLock; if (shouldLock && lockPowerOffArmed) { lockStateCheck.restart(); } diff --git a/quickshell/Modules/WallpaperBackground.qml b/quickshell/Modules/WallpaperBackground.qml index 01f135b0..7910e54f 100644 --- a/quickshell/Modules/WallpaperBackground.qml +++ b/quickshell/Modules/WallpaperBackground.qml @@ -151,6 +151,16 @@ Variants { } } + Connections { + target: IdleService + function onIsShellLockedChanged() { + if (!IdleService.isShellLocked) { + root._renderSettling = true; + renderSettleTimer.restart(); + } + } + } + Timer { id: renderSettleTimer interval: 1000 diff --git a/quickshell/Services/IdleService.qml b/quickshell/Services/IdleService.qml index a75fa97f..9965e47c 100644 --- a/quickshell/Services/IdleService.qml +++ b/quickshell/Services/IdleService.qml @@ -64,6 +64,7 @@ Singleton { property var suspendMonitor: null property var lockComponent: null property bool monitorsOff: false + property bool isShellLocked: false function wake() { requestMonitorOn();