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,20 +23,25 @@ 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)
|
||||
// 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);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue