diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 0f1752d6db6..330c84a4a6b 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -643,24 +643,25 @@ void QWaylandWindow::handleFrameCallback() // The rest can wait until we can run it on the correct thread if (!mWaitingForUpdateDelivery) { - auto doHandleExpose = [this]() { - bool wasExposed = isExposed(); - mFrameCallbackTimedOut = false; - if (!wasExposed && isExposed()) // Did setting mFrameCallbackTimedOut make the window exposed? - sendExposeEvent(QRect(QPoint(), geometry().size())); - if (wasExposed && hasPendingUpdateRequest()) - deliverUpdateRequest(); - - mWaitingForUpdateDelivery = false; - }; - // Queued connection, to make sure we don't call handleUpdate() from inside waitForFrameSync() // in the single-threaded case. mWaitingForUpdateDelivery = true; - QMetaObject::invokeMethod(this, doHandleExpose, Qt::QueuedConnection); + QMetaObject::invokeMethod(this, &QWaylandWindow::doHandleFrameCallback, Qt::QueuedConnection); } } +void QWaylandWindow::doHandleFrameCallback() +{ + bool wasExposed = isExposed(); + mFrameCallbackTimedOut = false; + if (!wasExposed && isExposed()) // Did setting mFrameCallbackTimedOut make the window exposed? + sendExposeEvent(QRect(QPoint(), geometry().size())); + if (wasExposed && hasPendingUpdateRequest()) + deliverUpdateRequest(); + + mWaitingForUpdateDelivery = false; +} + bool QWaylandWindow::waitForFrameSync(int timeout) { QMutexLocker locker(mFrameQueue.mutex); diff --git a/src/plugins/platforms/wayland/qwaylandwindow_p.h b/src/plugins/platforms/wayland/qwaylandwindow_p.h index 35850b8858a..c323618bdf2 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow_p.h +++ b/src/plugins/platforms/wayland/qwaylandwindow_p.h @@ -214,6 +214,7 @@ signals: void wlSurfaceDestroyed(); protected: + virtual void doHandleFrameCallback(); void sendExposeEvent(const QRect &rect); QWaylandDisplay *mDisplay = nullptr;