From 6a062f89559f4143d4ee0b84489ba6607f598b13 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 7 Feb 2023 18:32:41 +0100 Subject: [PATCH] Fix call to undefined restoreWindowGeometry Simply remove it, a proper solution would be to expose WindowsController to qml and then call the replacement for that but none seems to care about the tray support and I wish we could drop it. Signed-off-by: Carl Schwan --- src/qml/main.qml | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/src/qml/main.qml b/src/qml/main.qml index 7e652beb4..d646cdc6c 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -160,13 +160,32 @@ Kirigami.ApplicationWindow { Component.onCompleted: { Controller.setBlur(pageStack, Config.blur && !Config.compactLayout); - if (Config.minimizeToSystemTrayOnStartup && !Kirigami.Settings.isMobile && Controller.supportSystemTray && Config.systemTray) { - restoreWindowGeometryConnections.enabled = true; // To restore window size and position + if (Config.minimizeToSystemTrayOnStartup && !Kirigami.Settings.isMobile + && Controller.supportSystemTray && Config.systemTray) { + // To restore window size and position + restoreWindowGeometryConnections.enabled = true; } else { visible = true; saveWindowGeometryConnections.enabled = true; } } + + Connections { + id: restoreWindowGeometryConnections + enabled: false + target: root + + function onVisibleChanged() { + if (!visible) { + return; + } + // Only restore window geometry for the first time + restoreWindowGeometryConnections.enabled = false; + saveWindowGeometryConnections.enabled = true; + } + } + + Connections { target: Config function onBlurChanged() { @@ -184,7 +203,7 @@ Kirigami.ApplicationWindow { background: Rectangle { color: Config.blur && !Config.compactLayout ? Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 1 - Config.transparency) : "transparent" } - + Component { id: roomListComponent RoomList.Page { @@ -259,21 +278,6 @@ Kirigami.ApplicationWindow { } } - Connections { - id: restoreWindowGeometryConnections - enabled: false - target: root - - function onVisibleChanged() { - if (!visible) { - return; - } - Controller.restoreWindowGeometry(root); - restoreWindowGeometryConnections.enabled = false; // Only restore window geometry for the first time - saveWindowGeometryConnections.enabled = true; - } - } - Component { id: keyVerificationDialogComponent KeyVerificationDialog { }