platforms/wayland: Report correct damage to host compositor

damageHistory.first() is the previous damage region, we need to report
the current instead.
This commit is contained in:
Vlad Zahorodnii 2021-07-24 15:06:51 +03:00
parent e087b2ce2f
commit 1cbf232b98

View file

@ -315,8 +315,8 @@ void EglWaylandBackend::presentOnSurface(EglWaylandOutput *output, const QRegion
waylandOutput->surface()->setScale(std::ceil(waylandOutput->scale()));
Q_EMIT waylandOutput->outputChange(damage);
if (supportsSwapBuffersWithDamage() && !output->m_damageHistory.isEmpty()) {
QVector<EGLint> rects = regionToRects(output->m_damageHistory.constFirst(), waylandOutput);
if (supportsSwapBuffersWithDamage()) {
QVector<EGLint> rects = regionToRects(damage, waylandOutput);
if (!eglSwapBuffersWithDamageEXT(eglDisplay(), output->m_eglSurface,
rects.data(), rects.count() / 4)) {
qCCritical(KWIN_WAYLAND_BACKEND, "eglSwapBuffersWithDamage() failed: %x", eglGetError());