diff --git a/src/qml/Main.qml b/src/qml/Main.qml index b1e113d31..d545973bc 100644 --- a/src/qml/Main.qml +++ b/src/qml/Main.qml @@ -171,11 +171,9 @@ Kirigami.ApplicationWindow { if (ShareHandler.text && root.connection) { root.handleShare() } - if (NeoChatConfig.minimizeToSystemTrayOnStartup && !Kirigami.Settings.isMobile && Controller.supportSystemTray && NeoChatConfig.systemTray) { - restoreWindowGeometryConnections.enabled = true; // To restore window size and position - } else { + const hasSystemTray = Controller.supportSystemTray && NeoChatConfig.systemTray; + if (Kirigami.Settings.isMobile || !(hasSystemTray && NeoChatConfig.minimizeToSystemTrayOnStartup)) { visible = true; - saveWindowGeometryConnections.enabled = true; } } Connections { @@ -253,21 +251,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; - } - } - Connections { target: root.connection