privacy: detect active video streams only, not hardware sources
This commit is contained in:
parent
cd29baa4d5
commit
7e5afebada
1 changed files with 6 additions and 5 deletions
|
|
@ -7,12 +7,13 @@ Row {
|
||||||
id: root
|
id: root
|
||||||
spacing: M.Theme.moduleSpacing
|
spacing: M.Theme.moduleSpacing
|
||||||
|
|
||||||
readonly property bool _screenShare: {
|
// Only detect active client streams, not hardware sources/devices
|
||||||
|
readonly property bool _videoCapture: {
|
||||||
if (!Pipewire.nodes) return false;
|
if (!Pipewire.nodes) return false;
|
||||||
for (const node of Pipewire.nodes.values) {
|
for (const node of Pipewire.nodes.values) {
|
||||||
if (!node.isStream) continue;
|
if (!node.isStream) continue;
|
||||||
const mc = node.properties?.["media.class"] ?? "";
|
const mc = node.properties?.["media.class"] ?? "";
|
||||||
if (mc.includes("Video")) return true;
|
if (mc === "Stream/Input/Video" || mc === "Stream/Output/Video") return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -27,11 +28,11 @@ Row {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
visible: root._screenShare || root._audioIn
|
visible: root._videoCapture || root._audioIn
|
||||||
|
|
||||||
// Screenshare indicator
|
// Screenshare indicator
|
||||||
Text {
|
Text {
|
||||||
visible: root._screenShare
|
visible: root._videoCapture
|
||||||
text: "\uF03D"
|
text: "\uF03D"
|
||||||
color: M.Theme.base08
|
color: M.Theme.base08
|
||||||
font.pixelSize: M.Theme.fontSize + 2
|
font.pixelSize: M.Theme.fontSize + 2
|
||||||
|
|
@ -48,7 +49,7 @@ Row {
|
||||||
}
|
}
|
||||||
|
|
||||||
SequentialAnimation on opacity {
|
SequentialAnimation on opacity {
|
||||||
running: root._screenShare
|
running: root._videoCapture
|
||||||
loops: Animation.Infinite
|
loops: Animation.Infinite
|
||||||
NumberAnimation { to: 0.4; duration: 600; easing.type: Easing.InOutQuad }
|
NumberAnimation { to: 0.4; duration: 600; easing.type: Easing.InOutQuad }
|
||||||
NumberAnimation { to: 1; duration: 600; easing.type: Easing.InOutQuad }
|
NumberAnimation { to: 1; duration: 600; easing.type: Easing.InOutQuad }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue