diff --git a/composite.cpp b/composite.cpp --- a/composite.cpp +++ b/composite.cpp @@ -423,17 +423,6 @@ m_scene = NULL; compositeTimer.stop(); repaints_region = QRegion(); - if (Workspace::self()) { - for (ClientList::ConstIterator it = Workspace::self()->clientList().constBegin(); - it != Workspace::self()->clientList().constEnd(); - ++it) { - // forward all opacity values to the frame in case there'll be other CM running - if ((*it)->opacity() != 1.0) { - NETWinInfo i(connection(), (*it)->frameId(), rootWindow(), 0, 0); - i.setOpacity(static_cast< unsigned long >((*it)->opacity() * 0xffffffff)); - } - } - } m_finishing = false; emit compositingToggled(false); } diff --git a/manage.cpp b/manage.cpp --- a/manage.cpp +++ b/manage.cpp @@ -28,6 +28,7 @@ #ifdef KWIN_BUILD_ACTIVITIES #include "activities.h" #endif +#include "composite.h" #include "cursor.h" #include "rules.h" #include "group.h" @@ -652,6 +653,20 @@ setBlockingCompositing(info->isBlockingCompositing()); readShowOnScreenEdge(showOnScreenEdgeCookie); + // Forward all opacity values to the frame in case there'll be other CM running. + connect(Compositor::self(), &Compositor::compositingToggled, this, + [this](bool active) { + if (active) { + return; + } + if (opacity() == 1.0) { + return; + } + NETWinInfo info(connection(), frameId(), rootWindow(), 0, 0); + info.setOpacity(static_cast(opacity() * 0xffffffff)); + } + ); + // TODO: there's a small problem here - isManaged() depends on the mapping state, // but this client is not yet in Workspace's client list at this point, will // be only done in addClient()