Fix requestUpdate()

After commit 027a7131543b0194a7d9e98a6b53928e30bc080f, mFrameCallback
is set to null when the next buffer is attached, not when the callback
arrives. This means that a requestUpdate() after the frame callback
would never be delivered. The solution is to test mWaitingForFrameSync
instead. There is still a small race condition, but the failure case is
that the update will arrive after 5 ms instead of exactly at frame sync.

Change-Id: I413ed2b76c8527f825e501077bab712146b6705f
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
This commit is contained in:
Paul Olav Tvete 2018-01-08 13:30:51 +01:00
parent c177b75420
commit d4dc5f3573

View File

@ -1029,7 +1029,7 @@ QVariant QWaylandWindow::property(const QString &name, const QVariant &defaultVa
void QWaylandWindow::requestUpdate() void QWaylandWindow::requestUpdate()
{ {
if (!mFrameCallback) if (!mWaitingForFrameSync)
QPlatformWindow::requestUpdate(); QPlatformWindow::requestUpdate();
else else
mUpdateRequested = true; mUpdateRequested = true;