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
This commit is contained in:
parent
b107295c03
commit
92f1fabe5b
1 changed files with 13 additions and 10 deletions
|
@ -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…
Reference in a new issue