aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/animations
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@jollamobile.com>2014-07-30 08:22:15 +0200
committerGunnar Sletta <gunnar.sletta@jollamobile.com>2014-07-31 08:44:52 +0200
commit59d5c5cf555a51cd7559cea197a198ef3a792614 (patch)
treea783b764c3651803d904af23558855d46b3fe2f8 /src/qml/animations
parent93fe03a1c583b4b090948bf8d4d7e93cb8da4880 (diff)
Avoid eventloop recursion in touch event handling.
The eventloop recursion in the threaded render loop was there to preempt any pending event to make sure we worked with as recent as possible input events. The benefit of this was never verified. The recursion after the actual flush was to fix animations which were constantly started during touch events, such as a behavior tracking the mouse point. This is fixed differently. Event loop recursion is always dangerous, so we're doing what we can to avoid it. Change-Id: I120b2e98350e3b9068153415a671408773fbc769 Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src/qml/animations')
-rw-r--r--src/qml/animations/qabstractanimationjob.cpp2
-rw-r--r--src/qml/animations/qabstractanimationjob_p.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/qml/animations/qabstractanimationjob.cpp b/src/qml/animations/qabstractanimationjob.cpp
index 991b1fad5c..512d9c2914 100644
--- a/src/qml/animations/qabstractanimationjob.cpp
+++ b/src/qml/animations/qabstractanimationjob.cpp
@@ -147,6 +147,8 @@ void QQmlAnimationTimer::restartAnimationTimer()
void QQmlAnimationTimer::startAnimations()
{
+ if (!startAnimationPending)
+ return;
startAnimationPending = false;
//force timer to update, which prevents large deltas for our newly added animations
QUnifiedTimer::instance()->maybeUpdateAnimationsToCurrentTime();
diff --git a/src/qml/animations/qabstractanimationjob_p.h b/src/qml/animations/qabstractanimationjob_p.h
index c905fca0d7..994311ced0 100644
--- a/src/qml/animations/qabstractanimationjob_p.h
+++ b/src/qml/animations/qabstractanimationjob_p.h
@@ -215,7 +215,9 @@ public:
//useful for profiling/debugging
int runningAnimationCount() { return animations.count(); }
-private Q_SLOTS:
+ bool hasStartAnimationPending() const { return startAnimationPending; }
+
+public Q_SLOTS:
void startAnimations();
void stopTimer();