wayland_server: create a new screen locker connection when the greeter gets restarted

Otherwise, Wayland objects and protocol errors can cause the new instance to not start
wilder/Plasma/6.2
Xaver Hugl 2 years ago
parent b107295c03
commit 92f1fabe5b
  1. 23
      src/wayland_server.cpp

@ -625,16 +625,6 @@ void WaylandServer::initScreenLocker()
ScreenLocker::KSldApp::self()->setGreeterEnvironment(kwinApp()->processStartupEnvironment());
connect(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::aboutToLock, this, [this, screenLockerApp]() {
if (m_screenLockerClientConnection) {
// Already sent data to KScreenLocker.
return;
}
int clientFd = createScreenLockerConnection();
if (clientFd < 0) {
return;
}
ScreenLocker::KSldApp::self()->setWaylandFd(clientFd);
new LockScreenPresentationWatcher(this);
const QList<SeatInterface *> seatIfaces = m_display->seats();
@ -644,6 +634,19 @@ void WaylandServer::initScreenLocker()
}
});
connect(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::aboutToStartGreeter, this, [this]() {
if (m_screenLockerClientConnection) {
m_screenLockerClientConnection->destroy();
delete m_screenLockerClientConnection;
m_screenLockerClientConnection = nullptr;
}
int clientFd = createScreenLockerConnection();
if (clientFd < 0) {
return;
}
ScreenLocker::KSldApp::self()->setWaylandFd(clientFd);
});
connect(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::unlocked, this, [this, screenLockerApp]() {
if (m_screenLockerClientConnection) {
m_screenLockerClientConnection->destroy();

Loading…
Cancel
Save