Do not emit DecorationSettings::alphaChannelSupportedChanged on tear down
The Compositor is destroyed before the Client and Decorations are destroyed on shutdown. This meant the Decorations reacted needlessly on the alpha channel supported. E.g. Aurorae recreated the Decoration and most likely crashed in Qt. With this change the signal gets disconnected and the Decorations just don't do anything.
This commit is contained in:
parent
c815775a0e
commit
f78ff8eaa5
3 changed files with 9 additions and 1 deletions
|
@ -133,6 +133,7 @@ Compositor::Compositor(QObject* workspace)
|
|||
|
||||
Compositor::~Compositor()
|
||||
{
|
||||
emit aboutToDestroy();
|
||||
finish();
|
||||
deleteUnusedSupportProperties();
|
||||
delete cm_selection;
|
||||
|
|
|
@ -185,6 +185,7 @@ public Q_SLOTS:
|
|||
|
||||
Q_SIGNALS:
|
||||
void compositingToggled(bool active);
|
||||
void aboutToDestroy();
|
||||
|
||||
protected:
|
||||
void timerEvent(QTimerEvent *te);
|
||||
|
|
|
@ -39,7 +39,7 @@ SettingsImpl::SettingsImpl(KDecoration2::DecorationSettings *parent)
|
|||
{
|
||||
readSettings();
|
||||
|
||||
connect(Compositor::self(), &Compositor::compositingToggled,
|
||||
auto c = connect(Compositor::self(), &Compositor::compositingToggled,
|
||||
parent, &KDecoration2::DecorationSettings::alphaChannelSupportedChanged);
|
||||
connect(VirtualDesktopManager::self(), &VirtualDesktopManager::countChanged, this,
|
||||
[parent](uint previous, uint current) {
|
||||
|
@ -49,6 +49,12 @@ SettingsImpl::SettingsImpl(KDecoration2::DecorationSettings *parent)
|
|||
emit parent->onAllDesktopsAvailableChanged(current > 1);
|
||||
}
|
||||
);
|
||||
// prevent changes in Decoration due to Compositor being destroyed
|
||||
connect(Compositor::self(), &Compositor::aboutToDestroy, this,
|
||||
[this, c] {
|
||||
disconnect(c);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
SettingsImpl::~SettingsImpl() = default;
|
||||
|
|
Loading…
Reference in a new issue