Commit fd20c59a authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

Make Compositor::finish more generic

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:
parent b617613b
......@@ -423,17 +423,6 @@ void Compositor::finish()
m_scene = NULL;
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 <>.
#include "activities.h"
#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)
// 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) {
if (opacity() == 1.0) {
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