From f2d3c5289ff2508cbfa5b92a18d53888f0dc93a0 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 20 Jan 2022 22:26:17 +0000 Subject: [PATCH] Only consider the screen lock shown after the screen window is mapped This signal is sent back to the ksldapp after the greeter has registered a window with the compositor. Only once ksldapp gets this signal does it release the lock delaying suspend. With xdgshell/layershell we have a roundtrip of configuring before the window is even exposed, so we move to a different signal. This also helps encapsulate lockscreen code. Ideally we want to add code tracking frame rendering per screen tracked too, but that would be based off this change. CCBUG: 316734 --- src/wayland_server.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/wayland_server.cpp b/src/wayland_server.cpp index c4f738eddd..8bbbda4462 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) { -- GitLab