Fix tst_qdeclarativestates::anchorsRewindBug failure
authorGunnar Sletta <gunnar.sletta@nokia.com>
Fri, 6 Jan 2012 09:57:12 +0000 (10:57 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 9 Jan 2012 22:26:06 +0000 (23:26 +0100)
commit627bcb8a88f6c1be73b0bbd45f9488b37fd40e83
tree8e254f2bec7c5723a5fc5deb938d521c823b5756
parent97bc83ace2439eaf0cb7150338a4d8c92702adaa
Fix tst_qdeclarativestates::anchorsRewindBug failure

maybeUpdate() has an optimization to void locking the Gui thread
on every QQuickItem::update() call, which was faulty. When the
render thread was done rendering the flag should have been reset
which would have meant another locked sync between render and GUI.

Solve it slightly differently by posting an event to ourselves in GUI
and resetting the state once the event is processed. This batches all
update calls made until the GUI thread returns to the event loop, aka
all animation updates, all responds to one touch event, etc.

The isExternalUpdatePending variable, written from maybeUpdate, was
accumulated per canvas, but is used per render thread only, so this
change simplifies the variable to be per render thread only.

Task-number: QTBUG-23478
Change-Id: I067a9918383e3e05e2feebcc6dfa3163b032eb5b
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/quick/items/qquickwindowmanager.cpp
tests/auto/qtquick2/qdeclarativestates/tst_qdeclarativestates.cpp
tests/auto/qtquick2/qquickpositioners/tst_qquickpositioners.cpp