diff --git a/composite.cpp b/composite.cpp index 5408077f44..5c5c64783a 100644 --- a/composite.cpp +++ b/composite.cpp @@ -39,6 +39,7 @@ along with this program. If not, see . #if HAVE_WAYLAND #include "wayland_backend.h" #endif +#include "decorations/decoratedclient.h" #include @@ -1105,6 +1106,9 @@ bool Client::setupCompositing() if (!Toplevel::setupCompositing()){ return false; } + if (decoratedClient()) { + decoratedClient()->destroyRenderer(); + } updateVisibility(); // for internalKeep() return true; } @@ -1114,7 +1118,9 @@ void Client::finishCompositing(ReleaseReason releaseReason) Toplevel::finishCompositing(releaseReason); updateVisibility(); if (!deleting) { - triggerDecorationRepaint(); + if (decoratedClient()) { + decoratedClient()->destroyRenderer(); + } } // for safety in case KWin is just resizing the window s_haveResizeEffect = false; diff --git a/decorations/decoratedclient.cpp b/decorations/decoratedclient.cpp index d69177c113..14ae4f91a7 100644 --- a/decorations/decoratedclient.cpp +++ b/decorations/decoratedclient.cpp @@ -197,5 +197,11 @@ void DecoratedClientImpl::createRenderer() } } +void DecoratedClientImpl::destroyRenderer() +{ + delete m_renderer; + m_renderer = nullptr; +} + } } diff --git a/decorations/decoratedclient.h b/decorations/decoratedclient.h index 482853c914..100b9c3290 100644 --- a/decorations/decoratedclient.h +++ b/decorations/decoratedclient.h @@ -81,6 +81,7 @@ public: Renderer *renderer() { return m_renderer; } + void destroyRenderer(); KDecoration2::DecoratedClient *decoratedClient() { return KDecoration2::DecoratedClientPrivate::client(); }