diff --git a/src/wayland_server.cpp b/src/wayland_server.cpp index c4f738eddd4fd4b29951673eebd63ea1c2da714b..8bbbda44621961ca24685e4f8a3fce02c482e439 100644 --- a/src/wayland_server.cpp +++ b/src/wayland_server.cpp @@ -213,10 +213,6 @@ KWaylandServer::ClientConnection *WaylandServer::inputMethodConnection() const void WaylandServer::registerShellClient(AbstractClient *client) { - if (client->isLockScreen()) { - ScreenLocker::KSldApp::self()->lockScreenShown(); - } - if (client->readyForPainting()) { Q_EMIT shellClientAdded(client); } else { @@ -596,6 +592,12 @@ void WaylandServer::initScreenLocker() ScreenLocker::KSldApp::self()->setGreeterEnvironment(kwinApp()->processStartupEnvironment()); ScreenLocker::KSldApp::self()->initialize(); + connect(this, &WaylandServer::shellClientAdded, this, [](AbstractClient *client) { + if (client->isLockScreen()) { + ScreenLocker::KSldApp::self()->lockScreenShown(); + } + }); + connect(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::aboutToLock, this, [this, screenLockerApp] () { if (m_screenLockerClientConnection) {