Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions shell/plugins/services/idle/Service.qml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ Item {
if (!root.idleEnabled || !root.idledThisCycle || !root.screensaverStartedThisCycle) return
if (root.screensaverWindowCount > 0) return

// The window went because its output did (a monitor link flapping during
// the blank). That is not the user, and waking here would undo the blank.
if ((Quickshell.screens || []).length === 0) {
logEvent("screensaver-closed-no-outputs")
return
}

// The user dismissed the screensaver before the lock deadline. Treat that
// as activity and cancel the pending lock; the lock timer is only allowed
// to fire while the screensaver remains up.
Expand Down
5 changes: 5 additions & 0 deletions test/shell.d/idle-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ assert(
'idle ends a running cycle when both timeouts are set to 0'
)

assert(
/function handleScreensaverWindowClosed[\s\S]*?Quickshell\.screens \|\| \[\]\)\.length === 0\) \{[^}]*return\s*\}[\s\S]*?cancelIdleCycle\("screensaver-dismissed"\)/.test(serviceSource),
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
'idle does not treat a screensaver closed by losing every output as a dismissal'
)

assertDeepEqual(idle.eventParts({ data: 'a,b,c' }, 2), ['a', 'b', 'c'], 'idle parses raw event data')
assertDeepEqual(
idle.eventParts({ parse: function(count) { return ['parsed', count] } }, 4),
Expand Down