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