diff --git a/client.cpp b/client.cpp index 5c49b1691d..2e6966643e 100644 --- a/client.cpp +++ b/client.cpp @@ -630,6 +630,11 @@ void Client::updateShape() static Xcb::Window shape_helper_window(XCB_WINDOW_NONE); +void Client::cleanupX11() +{ + shape_helper_window.reset(); +} + void Client::updateInputShape() { if (hiddenPreview()) // Sets it to none, don't change diff --git a/client.h b/client.h index 7a28b547ba..08e25abe3a 100644 --- a/client.h +++ b/client.h @@ -355,6 +355,8 @@ public: **/ void showOnScreenEdge(); + static void cleanupX11(); + public Q_SLOTS: void closeWindow() override; void updateCaption(); diff --git a/libkwineffects/kwinglobals.h b/libkwineffects/kwinglobals.h index 18b78f44e7..3ae0d36b54 100644 --- a/libkwineffects/kwinglobals.h +++ b/libkwineffects/kwinglobals.h @@ -144,6 +144,7 @@ KWIN_EXPORT xcb_connection_t *connection() if (!s_con) { s_con = reinterpret_cast(qApp->property("x11Connection").value()); } + Q_ASSERT(qApp); return s_con; } diff --git a/workspace.cpp b/workspace.cpp index a179a198db..a179889b22 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -448,6 +448,7 @@ Workspace::~Workspace() m_allClients.removeAll(c); desktops.removeAll(c); } + Client::cleanupX11(); for (UnmanagedList::iterator it = unmanaged.begin(), end = unmanaged.end(); it != end; ++it) (*it)->release(ReleaseReason::KWinShutsDown); xcb_delete_property(connection(), rootWindow(), atoms->kwin_running);