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
screenTimeout: Settings.privacyScreenTimeout
timelineRoot: adaptiveView
windowTarget: MainWindow
}
}

View file

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

View file

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