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
44
shell/modules/ScreenCapture.qml
Normal file
44
shell/modules/ScreenCapture.qml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import "../services" as S
|
||||
|
||||
PanelWindow {
|
||||
id: root
|
||||
|
||||
required property var screen
|
||||
|
||||
color: "transparent"
|
||||
WlrLayershell.layer: WlrLayer.Background
|
||||
WlrLayershell.exclusiveZone: -1
|
||||
WlrLayershell.namespace: "nova-screenshot"
|
||||
mask: Region {}
|
||||
|
||||
anchors.top: true
|
||||
anchors.left: true
|
||||
anchors.right: true
|
||||
anchors.bottom: true
|
||||
|
||||
ScreencopyView {
|
||||
id: _capture
|
||||
anchors.fill: parent
|
||||
captureSource: root.screen
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: S.ScreenshotService
|
||||
function onCaptureRequested() {
|
||||
_capture.captureFrame();
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: _capture
|
||||
function onHasContentChanged() {
|
||||
if (_capture.hasContent)
|
||||
_capture.grabToImage(result => {
|
||||
S.ScreenshotService.store(root.screen.name, result);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -32,6 +32,7 @@ PowerModule 1.0 PowerModule.qml
|
|||
PowerProfileModule 1.0 PowerProfileModule.qml
|
||||
PrivacyModule 1.0 PrivacyModule.qml
|
||||
ProcessList 1.0 ProcessList.qml
|
||||
ScreenCapture 1.0 ScreenCapture.qml
|
||||
ScreenCorners 1.0 ScreenCorners.qml
|
||||
TemperatureModule 1.0 TemperatureModule.qml
|
||||
ThemedIcon 1.0 ThemedIcon.qml
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue