summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2022-03-15 15:59:15 +0100
committerPaul Olav Tvete <paul.tvete@qt.io>2022-03-21 15:40:30 +0100
commit08ce6129981576c93e0b3b9cc2a8b940646753fc (patch)
treede7386878213681fd76d3ac76dcb80da37a4a205
parenta04e0ac6deefc1a9df45e0e7dc1ea35a40401d27 (diff)
Revert "Client: Remove mWaitingForUpdateDelivery"
The reverted commit introduces a severe performance regression when a client window is resized while a QtQuick renderthread animation is running. This reverts commit feb1a5c207c13d0bf87c0d8ad039279dbf8cee9e. Fixes: QTBUG-101726 Change-Id: Ib5b52ce06efec8c86fada1623c2af82099e57fc6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
-rw-r--r--src/client/qwaylandwindow.cpp11
-rw-r--r--src/client/qwaylandwindow_p.h1
2 files changed, 9 insertions, 3 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 1ede38275..05e7160be 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -716,9 +716,12 @@ void QWaylandWindow::handleFrameCallback()
mFrameCallbackElapsedTimer.invalidate();
// The rest can wait until we can run it on the correct thread
- // Queued connection, to make sure we don't call handleUpdate() from inside waitForFrameSync()
- // in the single-threaded case.
- QMetaObject::invokeMethod(this, &QWaylandWindow::doHandleFrameCallback, Qt::QueuedConnection);
+ if (!mWaitingForUpdateDelivery) {
+ // Queued connection, to make sure we don't call handleUpdate() from inside waitForFrameSync()
+ // in the single-threaded case.
+ mWaitingForUpdateDelivery = true;
+ QMetaObject::invokeMethod(this, &QWaylandWindow::doHandleFrameCallback, Qt::QueuedConnection);
+ }
mFrameSyncWait.notify_all();
}
@@ -731,6 +734,8 @@ void QWaylandWindow::doHandleFrameCallback()
sendExposeEvent(QRect(QPoint(), geometry().size()));
if (wasExposed && hasPendingUpdateRequest())
deliverUpdateRequest();
+
+ mWaitingForUpdateDelivery = false;
}
bool QWaylandWindow::waitForFrameSync(int timeout)
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index 4bbcc93c3..d8eebb738 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -283,6 +283,7 @@ protected:
WId mWindowId;
bool mWaitingForFrameCallback = false;
bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out
+ bool mWaitingForUpdateDelivery = false;
int mFrameCallbackCheckIntervalTimerId = -1;
QElapsedTimer mFrameCallbackElapsedTimer;
struct ::wl_callback *mFrameCallback = nullptr;