[decorations] Don't recreate Renderer once the Compositor is destroyed

If we get a compositingToggled because the Compositor is going down we
don't need to recreate the Renderer as KWin as a whole is going down.

Thus we disconnect the compositingToggled connection when the Compositor
is about to be destroyed.
remotes/origin/Plasma/5.7
Martin Gräßlin 10 years ago
parent 1d9653953b
commit 00fe5ec401
  1. 8
      decorations/decoratedclient.cpp
  2. 1
      decorations/decoratedclient.h

@ -75,7 +75,7 @@ DecoratedClientImpl::DecoratedClientImpl(AbstractClient *client, KDecoration2::D
&Decoration::DecoratedClientImpl::signalShadeChange);
connect(client, &AbstractClient::keepAboveChanged, decoratedClient, &KDecoration2::DecoratedClient::keepAboveChanged);
connect(client, &AbstractClient::keepBelowChanged, decoratedClient, &KDecoration2::DecoratedClient::keepBelowChanged);
connect(Compositor::self(), &Compositor::compositingToggled, this,
m_compositorToggledConnection = connect(Compositor::self(), &Compositor::compositingToggled, this,
[this, decoration]() {
delete m_renderer;
m_renderer = nullptr;
@ -83,6 +83,12 @@ DecoratedClientImpl::DecoratedClientImpl(AbstractClient *client, KDecoration2::D
decoration->update();
}
);
connect(Compositor::self(), &Compositor::aboutToDestroy, this,
[this] {
disconnect(m_compositorToggledConnection);
m_compositorToggledConnection = QMetaObject::Connection();
}
);
connect(client, &AbstractClient::quickTileModeChanged, decoratedClient,
[this, decoratedClient]() {
emit decoratedClient->adjacentScreenEdgesChanged(adjacentScreenEdges());

@ -99,6 +99,7 @@ private:
void createRenderer();
AbstractClient *m_client;
Renderer *m_renderer;
QMetaObject::Connection m_compositorToggledConnection;
};
}

Loading…
Cancel
Save