pre-capture lock screen screenshots via hidden window and ScreenshotService
This commit is contained in:
parent
62cd0f9a76
commit
73e480d14b
7 changed files with 129 additions and 10 deletions
|
|
@ -20,12 +20,21 @@ Scope {
|
|||
lock: _lock
|
||||
}
|
||||
|
||||
// Capture screenshots before locking, with timeout for security
|
||||
Timer {
|
||||
id: _lockTimeout
|
||||
interval: 150
|
||||
onTriggered: _lock.locked = true
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: S.LockService
|
||||
|
||||
function onLockRequested() {
|
||||
if (S.LockService.enabled)
|
||||
_lock.locked = true;
|
||||
if (!S.LockService.enabled)
|
||||
return;
|
||||
S.ScreenshotService.capture(Quickshell.screens.length);
|
||||
_lockTimeout.start();
|
||||
}
|
||||
|
||||
function onUnlockRequested() {
|
||||
|
|
@ -39,6 +48,17 @@ Scope {
|
|||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: S.ScreenshotService
|
||||
|
||||
function onCaptureComplete() {
|
||||
if (_lockTimeout.running) {
|
||||
_lockTimeout.stop();
|
||||
_lock.locked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: _lock
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue