diff --git a/src/waylandwindow.cpp b/src/waylandwindow.cpp index b27b86d21d..31c389a2ac 100644 --- a/src/waylandwindow.cpp +++ b/src/waylandwindow.cpp @@ -35,6 +35,7 @@ enum WaylandGeometryType { Q_DECLARE_FLAGS(WaylandGeometryTypes, WaylandGeometryType) WaylandWindow::WaylandWindow(SurfaceInterface *surface) + : m_isScreenLocker(surface->client() == waylandServer()->screenLockerClientConnection()) { setSurface(surface); setDepth(32); @@ -46,8 +47,6 @@ WaylandWindow::WaylandWindow(SurfaceInterface *surface) connect(this, &WaylandWindow::desktopFileNameChanged, this, &WaylandWindow::updateIcon); connect(workspace(), &Workspace::outputsChanged, this, &WaylandWindow::updateClientOutputs); - connect(surface->client(), &ClientConnection::aboutToBeDestroyed, - this, &WaylandWindow::destroyWindow); updateResourceName(); updateIcon(); @@ -70,7 +69,7 @@ QString WaylandWindow::captionSuffix() const pid_t WaylandWindow::pid() const { - return surface()->client()->processId(); + return surface() ? surface()->client()->processId() : -1; } bool WaylandWindow::isClient() const @@ -80,7 +79,7 @@ bool WaylandWindow::isClient() const bool WaylandWindow::isLockScreen() const { - return surface()->client() == waylandServer()->screenLockerClientConnection(); + return m_isScreenLocker; } bool WaylandWindow::isLocalhost() const diff --git a/src/waylandwindow.h b/src/waylandwindow.h index 2be051eed5..2c7b5c8186 100644 --- a/src/waylandwindow.h +++ b/src/waylandwindow.h @@ -57,6 +57,7 @@ private: QString m_captionNormal; QString m_captionSuffix; bool m_isHidden = false; + bool m_isScreenLocker = false; }; } // namespace KWin