diff --git a/autotests/wayland/kwin_wayland_test.cpp b/autotests/wayland/kwin_wayland_test.cpp index ad651bee9e..566b234bfd 100644 --- a/autotests/wayland/kwin_wayland_test.cpp +++ b/autotests/wayland/kwin_wayland_test.cpp @@ -73,7 +73,7 @@ WaylandTestApplication::~WaylandTestApplication() } waylandServer()->destroyXWaylandConnection(); } - waylandServer()->destroyInternalConnection(); + waylandServer()->terminateClientConnections(); destroyCompositor(); } diff --git a/main_wayland.cpp b/main_wayland.cpp index 10d14d03f7..9a15e99964 100644 --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -97,7 +97,7 @@ ApplicationWayland::~ApplicationWayland() } waylandServer()->destroyXWaylandConnection(); } - waylandServer()->destroyInternalConnection(); + waylandServer()->terminateClientConnections(); destroyCompositor(); } diff --git a/wayland_server.cpp b/wayland_server.cpp index 4036a317ae..b026014188 100644 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -91,6 +91,16 @@ void WaylandServer::destroyInternalConnection() } } +void WaylandServer::terminateClientConnections() +{ + destroyInternalConnection(); + destroyInputMethodConnection(); + const auto connections = m_display->connections(); + for (auto it = connections.begin(); it != connections.end(); ++it) { + (*it)->destroy(); + } +} + void WaylandServer::init(const QByteArray &socketName, InitalizationFlags flags) { m_initFlags = flags; diff --git a/wayland_server.h b/wayland_server.h index b6514b6fe8..ba40d908c0 100644 --- a/wayland_server.h +++ b/wayland_server.h @@ -72,6 +72,7 @@ public: virtual ~WaylandServer(); void init(const QByteArray &socketName = QByteArray(), InitalizationFlags flags = InitalizationFlag::NoOptions); void initOutputs(); + void terminateClientConnections(); KWayland::Server::Display *display() { return m_display; @@ -123,7 +124,6 @@ public: bool isScreenLocked() const; void createInternalConnection(); - void destroyInternalConnection(); void initWorkspace(); KWayland::Server::ClientConnection *xWaylandConnection() const { @@ -156,6 +156,7 @@ Q_SIGNALS: private: quint16 createClientId(KWayland::Server::ClientConnection *c); + void destroyInternalConnection(); KWayland::Server::Display *m_display = nullptr; KWayland::Server::CompositorInterface *m_compositor = nullptr; KWayland::Server::SeatInterface *m_seat = nullptr;