From a930e59fcf0f8f388d5b8168abf57d6061adda4c Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 18 Aug 2020 13:18:58 +0300 Subject: [PATCH] Revert "Don't flush in SurfaceInterface::frameRendered()" This reverts commit 3cf004b68ef1df6e1d15f1746eafd779800b99d9. Unfortunately, 3cf004b broke a couple of tests in kwin due to Qt not emitting QAbstractEventDispatcher::aboutToBlock() signal when macros such as QTRY_VERIFY() or QTRY_COMPARE() spin the event loop. --- src/wayland/surface_interface.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wayland/surface_interface.cpp b/src/wayland/surface_interface.cpp index 0a61f8ed6a..9587b1f382 100644 --- a/src/wayland/surface_interface.cpp +++ b/src/wayland/surface_interface.cpp @@ -426,6 +426,7 @@ QList SurfaceInterface::surfaces() void SurfaceInterface::frameRendered(quint32 msec) { // notify all callbacks + const bool needsFlush = !d->current.frameCallbacks.isEmpty(); while (!d->current.frameCallbacks.isEmpty()) { KWaylandFrameCallback *frameCallback = d->current.frameCallbacks.takeFirst(); frameCallback->send_done(msec); @@ -438,6 +439,9 @@ void SurfaceInterface::frameRendered(quint32 msec) } subSurface->d_func()->surface->frameRendered(msec); } + if (needsFlush) { + client()->flush(); + } } QMatrix4x4 SurfaceInterfacePrivate::buildSurfaceToBufferMatrix(const State *state)