diff --git a/resources/qml/ChatPage.qml b/resources/qml/ChatPage.qml index c39f442e..cc62d501 100644 --- a/resources/qml/ChatPage.qml +++ b/resources/qml/ChatPage.qml @@ -143,6 +143,7 @@ Rectangle { visible: Settings.privacyScreen screenTimeout: Settings.privacyScreenTimeout timelineRoot: adaptiveView + windowTarget: MainWindow } } diff --git a/resources/qml/PrivacyScreen.qml b/resources/qml/PrivacyScreen.qml index d312172e..f91e4a73 100644 --- a/resources/qml/PrivacyScreen.qml +++ b/resources/qml/PrivacyScreen.qml @@ -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"; } diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml index 52370746..69e12907 100644 --- a/resources/qml/RoomList.qml +++ b/resources/qml/RoomList.qml @@ -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 + } } }