From 375691c6c21162ddcf49f072e648ee5ebc701c0e Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Wed, 23 Sep 2020 22:32:33 +0200 Subject: [PATCH] Improve opacity detection If the opaque area covers all the window's shape, it means that it's an opaque window. This is how GTK presents opacity right now, so we'll get to skip rendering under GTK clients and other compatible ones. Qt is still not emitting opacity. --- scene.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scene.cpp b/scene.cpp index cb121ef10..edb447f87 100644 --- a/scene.cpp +++ b/scene.cpp @@ -294,6 +294,10 @@ void Scene::paintSimpleScreen(int orig_mask, const QRegion ®ion) const QRegion shape = windowPixmap->mapToGlobal(windowPixmap->shape()); const QRegion opaque = windowPixmap->mapToGlobal(windowPixmap->opaque()); data.clip = shape & opaque; + + if (opaque == shape) { + data.mask = orig_mask | PAINT_WINDOW_OPAQUE; + } } } else { data.clip = QRegion();