Commit fd20c59a authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

Make Compositor::finish more generic

Summary:
KWin is not only an X11 compositing window manager, but also a Wayland
compositor. The Compositor class is used in both cases so in general it
would be nice to keep it as much as possible generic.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19879
parent b617613b
......@@ -423,17 +423,6 @@ void Compositor::finish()
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);
}
......
......@@ -28,6 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef KWIN_BUILD_ACTIVITIES
#include "activities.h"
#endif
#include "composite.h"
#include "cursor.h"
#include "rules.h"
#include "group.h"
......@@ -652,6 +653,20 @@ bool Client::manage(xcb_window_t w, bool isMapped)
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<unsigned long>(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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment