diff --git a/quickshell/Modules/Lock/LockScreenContent.qml b/quickshell/Modules/Lock/LockScreenContent.qml index 1791ebd7d..01e5d1634 100644 --- a/quickshell/Modules/Lock/LockScreenContent.qml +++ b/quickshell/Modules/Lock/LockScreenContent.qml @@ -36,6 +36,7 @@ Item { property int hyprlandLayoutCount: 0 property bool lockerReadySent: false property bool lockerReadyArmed: false + property var sessionLock: null readonly property bool hasCustomWallpaper: SettingsData.lockScreenWallpaperPath !== "" readonly property string lockFontFamily: SettingsData.lockScreenFontFamily @@ -134,12 +135,27 @@ Item { return; if (!root.visible || root.opacity <= 0) return; + // Don't report ready until the compositor has confirmed the session is + // locked (ext-session-lock `locked` event). Qt's afterRendering fires + // before the lock surface is committed/presented, so releasing the sleep + // inhibitor on it lets the machine freeze with the desktop still on screen, + // which then flashes on resume. secure=true guarantees the desktop is hidden. + if (root.sessionLock && !root.sessionLock.secure) + return; Qt.callLater(() => { if (root.visible && root.opacity > 0 && !root.unlocking) sendLockerReadyOnce(); }); } + Connections { + target: root.sessionLock + enabled: target !== null + function onSecureChanged() { + root.maybeSend(); + } + } + Connections { target: root.Window.window enabled: target !== null diff --git a/quickshell/Modules/Lock/LockSurface.qml b/quickshell/Modules/Lock/LockSurface.qml index d4a88a82e..f41a82666 100644 --- a/quickshell/Modules/Lock/LockSurface.qml +++ b/quickshell/Modules/Lock/LockSurface.qml @@ -33,6 +33,7 @@ FocusScope { anchors.fill: parent demoMode: false + sessionLock: root.lock pam: root.pam passwordBuffer: root.sharedPasswordBuffer screenName: root.screenName