[plasma/discover] discover/qml: ui: Only keep a state saver around when we are visible

Aleix Pol Gonzalez <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 179e5fd34229997ac02c6003155756b4c212c51d by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 24/07/2026 at 09:29.
Pushed by apol into branch 'master'.

ui: Only keep a state saver around when we are visible

M  +5    -2    discover/qml/DiscoverWindow.qml

https://invent.kde.org/plasma/discover/-/commit/179e5fd34229997ac02c6003155756b4c212c51d

diff --git a/discover/qml/DiscoverWindow.qml b/discover/qml/DiscoverWindow.qml
index f2c00c7a4..47c84de26 100644
--- a/discover/qml/DiscoverWindow.qml
+++ b/discover/qml/DiscoverWindow.qml
@@ -39,8 +39,11 @@ Kirigami.ApplicationWindow {
     
     readonly property Item leftPage: window.pageStack.depth > 0 ? window.pageStack.get(0) : null
 
-    KConfig.WindowStateSaver {
-        configGroupName: "MainWindow"
+    Loader {
+        sourceComponent: KConfig.WindowStateSaver {
+            configGroupName: "MainWindow"
+        }
+        active: window.visible
     }
 
     Component.onCompleted: {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.