Make PrivacyScreen work on Popped-out Rooms

This commit is contained in:
Joseph Donofry 2022-05-12 14:56:22 -04:00
parent d130c96160
commit 7f2ae13c43
No known key found for this signature in database
GPG key ID: E8A1D78EF044B0CB
3 changed files with 15 additions and 3 deletions

View file

@ -143,6 +143,7 @@ Rectangle {
visible: Settings.privacyScreen visible: Settings.privacyScreen
screenTimeout: Settings.privacyScreenTimeout screenTimeout: Settings.privacyScreenTimeout
timelineRoot: adaptiveView timelineRoot: adaptiveView
windowTarget: MainWindow
} }
} }

View file

@ -14,9 +14,11 @@ Item {
property var timelineRoot property var timelineRoot
property int screenTimeout property int screenTimeout
required property var windowTarget
Connections { Connections {
function onActiveChanged() { function onActiveChanged() {
if (MainWindow.active) { if (windowTarget.active) {
screenSaverTimer.stop(); screenSaverTimer.stop();
screenSaver.state = "Invisible"; screenSaver.state = "Invisible";
} else { } else {
@ -26,14 +28,14 @@ Item {
} }
} }
target: MainWindow target: windowTarget
} }
Timer { Timer {
id: screenSaverTimer id: screenSaverTimer
interval: screenTimeout * 1000 interval: screenTimeout * 1000
running: !MainWindow.active running: !windowTarget.active
onTriggered: { onTriggered: {
screenSaver.state = "Visible"; screenSaver.state = "Visible";
} }

View file

@ -92,10 +92,19 @@ Page {
} }
TimelineView { TimelineView {
id: timelineView
anchors.fill: parent anchors.fill: parent
room: roomWindowW.room room: roomWindowW.room
roomPreview: roomWindowW.roomPreview.roomid ? roomWindowW.roomPreview : null roomPreview: roomWindowW.roomPreview.roomid ? roomWindowW.roomPreview : null
} }
PrivacyScreen {
anchors.fill: parent
visible: Settings.privacyScreen
screenTimeout: Settings.privacyScreenTimeout
timelineRoot: timelineView
windowTarget: roomWindowW
}
} }
} }