Destroy DecorationRenderer in setup/finish compositing
So far the DecorationRenderer got destroyed and recreated after the signal compositing toggled was emitted. But that's too late for e.g. the OpenGL Textures to be destroyed. So lets trigger the destroy directly in setup/finish compositing. The new renderer will still be created after the compositing toggled is emitted - we don't want to have it recreated for the still active compositer type.
This commit is contained in:
parent
8bf2a9855a
commit
c8c0bace31
3 changed files with 14 additions and 1 deletions
|
@ -39,6 +39,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#if HAVE_WAYLAND
|
||||
#include "wayland_backend.h"
|
||||
#endif
|
||||
#include "decorations/decoratedclient.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
@ -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;
|
||||
|
|
|
@ -197,5 +197,11 @@ void DecoratedClientImpl::createRenderer()
|
|||
}
|
||||
}
|
||||
|
||||
void DecoratedClientImpl::destroyRenderer()
|
||||
{
|
||||
delete m_renderer;
|
||||
m_renderer = nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,6 +81,7 @@ public:
|
|||
Renderer *renderer() {
|
||||
return m_renderer;
|
||||
}
|
||||
void destroyRenderer();
|
||||
KDecoration2::DecoratedClient *decoratedClient() {
|
||||
return KDecoration2::DecoratedClientPrivate::client();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue