diff options
author | Jungi Byun <jungi.byun@lge.com> | 2021-02-23 13:20:20 +0900 |
---|---|---|
committer | Jungi Byun <jungi.byun@lge.com> | 2021-03-08 06:51:17 +0900 |
commit | d49c1d0e7f06d1d82dd9aab7757a2a59a3cf7baa (patch) | |
tree | e6e05eb31fbcada1c6e3136bf7d900d32ff6314f /src/client/qwaylandwindow.cpp | |
parent | 23718100e09b629c4f5f9942dc469d604b8039ed (diff) | |
download | qtwayland-d49c1d0e7f06d1d82dd9aab7757a2a59a3cf7baa.tar.gz |
Support handleFrameCallback to derived classes
The lambda expression doHandleExpose() is used in handleFrameCallback()
to deal with exposure.
In order to support platform specific implementation for frame callback,
make the method doHandleExpose() into a virtual protected member
doHandleFrameCallback() in QWaylandWindow.
Change-Id: I8b22d4a552c72db1620d606929005917588c680d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/client/qwaylandwindow.cpp')
-rw-r--r-- | src/client/qwaylandwindow.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 0f1752d6..330c84a4 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/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); |