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.
This commit is contained in:
Aleix Pol 2020-09-23 22:32:33 +02:00 committed by Aleix Pol Gonzalez
parent a58100fc72
commit 375691c6c2

View file

@ -294,6 +294,10 @@ void Scene::paintSimpleScreen(int orig_mask, const QRegion &region)
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();