Make SurfaceItemX11 schedule a repaint if the shape changes

This commit is contained in:
Vlad Zahorodnii 2022-05-04 15:52:02 +03:00
parent 94d30c2268
commit 54bbfde2f3
2 changed files with 8 additions and 1 deletions

View file

@ -18,7 +18,7 @@ SurfaceItemX11::SurfaceItemX11(Window *window, Item *parent)
connect(window, &Window::bufferGeometryChanged,
this, &SurfaceItemX11::handleBufferGeometryChanged);
connect(window, &Window::geometryShapeChanged,
this, &SurfaceItemX11::discardQuads);
this, &SurfaceItemX11::handleGeometryShapeChanged);
m_damageHandle = xcb_generate_id(kwinApp()->x11Connection());
xcb_damage_create(kwinApp()->x11Connection(), m_damageHandle, window->frameId(),
@ -123,6 +123,12 @@ void SurfaceItemX11::handleBufferGeometryChanged(Window *window, const QRect &ol
setSize(window->bufferGeometry().size());
}
void SurfaceItemX11::handleGeometryShapeChanged()
{
scheduleRepaint(boundingRect());
discardQuads();
}
QRegion SurfaceItemX11::shape() const
{
const QRect clipRect = window()->clientGeometry().translated(-window()->bufferGeometry().topLeft());

View file

@ -37,6 +37,7 @@ public:
private Q_SLOTS:
void handleBufferGeometryChanged(Window *window, const QRect &old);
void handleGeometryShapeChanged();
protected:
SurfacePixmap *createPixmap() override;