diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index bfc52a816c..26690c78cf 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -696,6 +696,8 @@ void QGuiApplicationPrivate::init() // trigger registering of QVariant's GUI types qRegisterGuiVariant(); + QWindowSystemInterfacePrivate::eventTime.start(); + is_app_running = true; init_plugins(pluginList); QWindowSystemInterface::sendWindowSystemEvents(QCoreApplicationPrivate::eventDispatcher, QEventLoop::AllEvents); diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp index 6f0abbdd0c..be9ac8e545 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp +++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp @@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE -QTime QWindowSystemInterfacePrivate::eventTime; +QElapsedTimer QWindowSystemInterfacePrivate::eventTime; //------------------------------------------------------------ // @@ -266,10 +266,6 @@ void QWindowSystemInterfacePrivate::queueWindowSystemEvent(QWindowSystemInterfac windowSystemEventQueue.append(ev); queueMutex.unlock(); - // Make sure the event timer is started. - if (!QWindowSystemInterfacePrivate::eventTime.isValid()) - QWindowSystemInterfacePrivate::eventTime.start(); - QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::qt_qpa_core_dispatcher(); if (dispatcher) dispatcher->wakeUp(); diff --git a/src/gui/kernel/qwindowsysteminterface_qpa_p.h b/src/gui/kernel/qwindowsysteminterface_qpa_p.h index f5c141b4c9..fe97b486ad 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa_p.h +++ b/src/gui/kernel/qwindowsysteminterface_qpa_p.h @@ -42,6 +42,7 @@ #define QWINDOWSYSTEMINTERFACE_QPA_P_H #include "qwindowsysteminterface_qpa.h" +#include QT_BEGIN_HEADER @@ -272,7 +273,7 @@ public: static WindowSystemEvent * getWindowSystemEvent(); static void queueWindowSystemEvent(WindowSystemEvent *ev); - static QTime eventTime; + static QElapsedTimer eventTime; static QList convertTouchPoints(const QList &points, QEvent::Type *type); };