Send damage for window decorations
Compositors that only update damaged regions would show the old content of the decorations. [ChangeLog][QPA plugin] Fixed the window decorations sometimes not updating on some compositors. Change-Id: I75ab40e159bf165152a58e438dd7f70e7f9e9b22 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
parent
ede3963eba
commit
9706945157
@ -100,6 +100,16 @@ void QWaylandAbstractDecoration::setWaylandWindow(QWaylandWindow *window)
|
||||
d->m_wayland_window = window;
|
||||
}
|
||||
|
||||
static QRegion marginsRegion(const QSize &size, const QMargins &margins)
|
||||
{
|
||||
QRegion r;
|
||||
r += QRect(0, 0, size.width(), margins.top()); // top
|
||||
r += QRect(0, size.height()+margins.top(), size.width(), margins.bottom()); //bottom
|
||||
r += QRect(0, 0, margins.left(), size.height()); //left
|
||||
r += QRect(size.width()+margins.left(), 0, margins.right(), size.height()); // right
|
||||
return r;
|
||||
}
|
||||
|
||||
const QImage &QWaylandAbstractDecoration::contentImage()
|
||||
{
|
||||
Q_D(QWaylandAbstractDecoration);
|
||||
@ -113,6 +123,10 @@ const QImage &QWaylandAbstractDecoration::contentImage()
|
||||
d->m_decorationContentImage.fill(Qt::transparent);
|
||||
this->paint(&d->m_decorationContentImage);
|
||||
|
||||
QRegion damage = marginsRegion(window()->frameGeometry().size(), window()->frameMargins());
|
||||
for (QRect r : damage)
|
||||
waylandWindow()->damage(r);
|
||||
|
||||
d->m_isDirty = false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user