Properly intersect the shape with clipRect

That for loop in the end didn't have any effect,
actually compute the final region and return that one
This commit is contained in:
Marco Martin 2024-03-11 12:42:21 +01:00
parent 9302e84b95
commit 609833e880

View file

@ -157,11 +157,12 @@ QList<QRectF> SurfaceItemX11::shape() const
{
const QRectF clipRect = m_window->clientGeometry().translated(-m_window->bufferGeometry().topLeft());
QList<QRectF> shape = m_window->shapeRegion();
QList<QRectF> shapeRegion;
// bounded to clipRect
for (QRectF &shapePart : shape) {
shapePart = shapePart.intersected(clipRect);
shapeRegion += shapePart.intersected(clipRect);
}
return shape;
return shapeRegion;
}
QRegion SurfaceItemX11::opaque() const