fix screenshot capture: hide from wallpaper, refresh on each lock

This commit is contained in:
Damocles 2026-04-18 12:46:21 +02:00
parent 73e480d14b
commit 7265515d64

View file

@ -23,22 +23,27 @@ PanelWindow {
id: _capture
anchors.fill: parent
captureSource: root.screen
visible: false
}
Connections {
target: S.ScreenshotService
function onCaptureRequested() {
_capture.captureFrame();
_grabTimer.start();
}
}
Connections {
target: _capture
function onHasContentChanged() {
if (_capture.hasContent)
_capture.grabToImage(result => {
S.ScreenshotService.store(root.screen.name, result);
});
// Brief delay for the frame to arrive, then grab
Timer {
id: _grabTimer
interval: 50
onTriggered: {
_capture.visible = true;
_capture.grabToImage(result => {
_capture.visible = false;
S.ScreenshotService.store(root.screen.name, result);
});
}
}
}