diff --git a/effects/blur/blur.h b/effects/blur/blur.h --- a/effects/blur/blur.h +++ b/effects/blur/blur.h @@ -131,7 +131,7 @@ QVector blurStrengthValues; QMap windowBlurChangedConnections; - KWayland::Server::BlurManagerInterface *m_blurManager = nullptr; + KWayland::Server::BlurManagerInterface *s_blurManager = nullptr; }; inline diff --git a/effects/blur/blur.cpp b/effects/blur/blur.cpp --- a/effects/blur/blur.cpp +++ b/effects/blur/blur.cpp @@ -57,8 +57,10 @@ net_wm_blur_region = effects->announceSupportProperty(s_blurAtomName, this); KWayland::Server::Display *display = effects->waylandDisplay(); if (display) { - m_blurManager = display->createBlurManager(this); - m_blurManager->create(); + if (!s_blurManager) { + s_blurManager = display->createBlurManager(display); + } + s_blurManager->create(); } } else { net_wm_blur_region = 0; @@ -83,6 +85,9 @@ BlurEffect::~BlurEffect() { + // remove from registry to signify that we no longer have a blur effect, but keep global alive + // in case clients are binding + s_blurManager->remove(); deleteFBOs(); } @@ -264,8 +269,7 @@ if (!m_shader || !m_shader->isValid()) { effects->removeSupportProperty(s_blurAtomName, this); - delete m_blurManager; - m_blurManager = nullptr; + s_blurManager->remove(); } // Update all windows for the blur to take effect