diff options
-rw-r--r-- | src/qml/animations/qabstractanimationjob.cpp | 2 | ||||
-rw-r--r-- | src/qml/animations/qabstractanimationjob_p.h | 4 | ||||
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 8 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 12 |
4 files changed, 12 insertions, 14 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(); diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 0c71254169..f57d04dfad 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -1838,9 +1838,11 @@ void QQuickWindowPrivate::flushDelayedTouchEvent() delete delayedTouch; delayedTouch = 0; - // To flush pending meta-calls triggered from the recently flushed touch events. - // This is safe because flushDelayedEvent is only called from eventhandlers. - QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); + // Touch events which constantly start animations (such as a behavior tracking + // the mouse point) need animations to start. + QQmlAnimationTimer *ut = QQmlAnimationTimer::instance(); + if (ut && ut->hasStartAnimationPending()) + ut->startAnimations(); } } diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index a74a51146e..793a247427 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -1066,17 +1066,9 @@ void QSGThreadedRenderLoop::polishAndSync(Window *w, bool inExpose) } // Flush pending touch events. - // First we force flushing of the windowing system events, so that we're - // working with the latest possible data. This can trigger event processing - // which in turn can stop rendering this window, so verify that before - // proceeding. Then we flush the touch event and as that also does event - // processing, verify again that we still are active and rendering. - QWindowSystemInterface::flushWindowSystemEvents(); + QQuickWindowPrivate::get(window)->flushDelayedTouchEvent(); + // The delivery of the event might have caused the window to stop rendering w = windowFor(m_windows, window); - if (w) { - QQuickWindowPrivate::get(window)->flushDelayedTouchEvent(); - w = windowFor(m_windows, window); - } if (!w || !w->thread || !w->thread->window) { qCDebug(QSG_LOG_RENDERLOOP) << "- removed after event flushing, abort"; killTimer(w->timerId); |