diff --git a/shell/lock/LockSurface.qml b/shell/lock/LockSurface.qml index 6c1620d..27f14f9 100644 --- a/shell/lock/LockSurface.qml +++ b/shell/lock/LockSurface.qml @@ -229,6 +229,22 @@ WlSessionLockSurface { _keyInput.forceActiveFocus(); } + // Skip entrance animations on wake from sleep - lock was already visible + Connections { + target: S.SleepService + + function onWokeFromSleep() { + if (!root.lock.locked) + return; + // Qt.callLater ensures this runs after onVisibleChanged resets + Qt.callLater(() => { + _overlay._revealed = true; + _clockItem._revealed = true; + _widgetCol._revealed = true; + }); + } + } + // Sync TextInput when auth clears buffer externally (PAM submit, lock reset) Connections { target: root.auth diff --git a/shell/services/SleepService.qml b/shell/services/SleepService.qml new file mode 100644 index 0000000..4c84577 --- /dev/null +++ b/shell/services/SleepService.qml @@ -0,0 +1,22 @@ +pragma Singleton + +import QtQuick +import Quickshell.Io + +QtObject { + id: root + + signal wokeFromSleep + + property Process _monitor: Process { + running: true + command: ["gdbus", "monitor", "--system", "--dest", "org.freedesktop.login1", "--object-path", "/org/freedesktop/login1"] + + stdout: SplitParser { + onRead: data => { + if (data.indexOf("PrepareForSleep") !== -1 && data.indexOf("false") !== -1) + root.wokeFromSleep(); + } + } + } +} diff --git a/shell/services/qmldir b/shell/services/qmldir index 901fd4e..98ac21f 100644 --- a/shell/services/qmldir +++ b/shell/services/qmldir @@ -13,6 +13,7 @@ singleton NiriIpc 1.0 NiriIpc.qml singleton NotifService 1.0 NotifService.qml singleton PowerProfileService 1.0 PowerProfileService.qml singleton ScreenshotService 1.0 ScreenshotService.qml +singleton SleepService 1.0 SleepService.qml singleton SystemStats 1.0 SystemStats.qml singleton Theme 1.0 Theme.qml singleton WeatherService 1.0 WeatherService.qml