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 e625089f40ab5b2f3220a9ffc3e047d1c3fc2740. Fixes: QTBUG-101726 Change-Id: Ib5b52ce06efec8c86fada1623c2af82099e57fc6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This commit is contained in:
parent
077df2acef
commit
eddb08768f
@ -716,9 +716,12 @@ void QWaylandWindow::handleFrameCallback()
|
|||||||
mFrameCallbackElapsedTimer.invalidate();
|
mFrameCallbackElapsedTimer.invalidate();
|
||||||
|
|
||||||
// The rest can wait until we can run it on the correct thread
|
// The rest can wait until we can run it on the correct thread
|
||||||
|
if (!mWaitingForUpdateDelivery) {
|
||||||
// Queued connection, to make sure we don't call handleUpdate() from inside waitForFrameSync()
|
// Queued connection, to make sure we don't call handleUpdate() from inside waitForFrameSync()
|
||||||
// in the single-threaded case.
|
// in the single-threaded case.
|
||||||
|
mWaitingForUpdateDelivery = true;
|
||||||
QMetaObject::invokeMethod(this, &QWaylandWindow::doHandleFrameCallback, Qt::QueuedConnection);
|
QMetaObject::invokeMethod(this, &QWaylandWindow::doHandleFrameCallback, Qt::QueuedConnection);
|
||||||
|
}
|
||||||
|
|
||||||
mFrameSyncWait.notify_all();
|
mFrameSyncWait.notify_all();
|
||||||
}
|
}
|
||||||
@ -731,6 +734,8 @@ void QWaylandWindow::doHandleFrameCallback()
|
|||||||
sendExposeEvent(QRect(QPoint(), geometry().size()));
|
sendExposeEvent(QRect(QPoint(), geometry().size()));
|
||||||
if (wasExposed && hasPendingUpdateRequest())
|
if (wasExposed && hasPendingUpdateRequest())
|
||||||
deliverUpdateRequest();
|
deliverUpdateRequest();
|
||||||
|
|
||||||
|
mWaitingForUpdateDelivery = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QWaylandWindow::waitForFrameSync(int timeout)
|
bool QWaylandWindow::waitForFrameSync(int timeout)
|
||||||
|
@ -283,6 +283,7 @@ protected:
|
|||||||
WId mWindowId;
|
WId mWindowId;
|
||||||
bool mWaitingForFrameCallback = false;
|
bool mWaitingForFrameCallback = false;
|
||||||
bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out
|
bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out
|
||||||
|
bool mWaitingForUpdateDelivery = false;
|
||||||
int mFrameCallbackCheckIntervalTimerId = -1;
|
int mFrameCallbackCheckIntervalTimerId = -1;
|
||||||
QElapsedTimer mFrameCallbackElapsedTimer;
|
QElapsedTimer mFrameCallbackElapsedTimer;
|
||||||
struct ::wl_callback *mFrameCallback = nullptr;
|
struct ::wl_callback *mFrameCallback = nullptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user