fix screenshot capture: hide from wallpaper, refresh on each lock
This commit is contained in:
parent
73e480d14b
commit
7265515d64
1 changed files with 12 additions and 7 deletions
|
|
@ -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);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue