[plasma/plasma-login-manager/Plasma/6.7] src/frontend/greeter: frontend/greeter: Fix loss of QML engine when all greeter windows destroyed

Oliver Beard <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 1c99b3b1f161ca880f8a8154d9258ced26ba7a7a by Oliver Beard.
Committed on 23/07/2026 at 08:54.
Pushed by olib into branch 'Plasma/6.7'.

frontend/greeter: Fix loss of QML engine when all greeter windows destroyed

We need to keep the engine, else newly created windows cannot use the singletons and the greeter is broken.

This is not an issue in 6.8/master because of refactoring in 562becde (port from `QuickViewSharedEngine`), as `LoginGreeter` owns and retains a `QQmlEngine`.

BUG: 523313
FIXED-IN: 6.7.4

M  +3    -0    src/frontend/greeter/main.cpp

https://invent.kde.org/plasma/plasma-login-manager/-/commit/1c99b3b1f161ca880f8a8154d9258ced26ba7a7a

diff --git a/src/frontend/greeter/main.cpp b/src/frontend/greeter/main.cpp
index 29a75ebb..699e2ad0 100644
--- a/src/frontend/greeter/main.cpp
+++ b/src/frontend/greeter/main.cpp
@@ -15,6 +15,7 @@
 #include <KWindowSystem>
 #include <LayerShellQt/Window>
 #include <PlasmaQuick/QuickViewSharedEngine>
+#include <PlasmaQuick/SharedQmlEngine>
 #include <kworkspace6/sessionmanagement.h>
 
 #include "backend/GreeterProxy.h"
@@ -33,6 +34,7 @@ class LoginGreeter : public QObject
 public:
     explicit LoginGreeter(QObject *parent = nullptr)
         : QObject(parent)
+        , m_engine(new PlasmaQuick::SharedQmlEngine)
     {
         connect(qApp, &QGuiApplication::screenAdded, this, [this](QScreen *screen) {
             createWindowForScreen(screen);
@@ -89,6 +91,7 @@ private:
         window->show();
     }
 
+    PlasmaQuick::SharedQmlEngine m_engine;
     static bool s_testMode;
 };
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.