From 9301d485430daaf39cbcfe70d4223d4afe7037c8 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 17 May 2017 16:12:01 +0200 Subject: [PATCH] QGuiApplication: Initialize and clear static variables Running: tst_qapplication focusMouseClick touchEventPropagation produced: FAIL! : tst_QApplication::touchEventPropagation() 'window.seenMouseEvent' returned FALSE. () since QGuiApplicationPrivate::mouse_buttons was not cleared when destroying and re-instantiating QGuiApplication. Add more initialization and clear screen list on exit. Change-Id: I0d814852c362d4a86f1ff5d6a94ab00d32ed30b9 Reviewed-by: Gatis Paeglis --- src/gui/kernel/qguiapplication.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 1dd019cd55..c0b0acbda6 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -634,6 +634,18 @@ QGuiApplication::~QGuiApplication() QGuiApplicationPrivate::m_inputDeviceManager = 0; delete QGuiApplicationPrivate::desktopFileName; QGuiApplicationPrivate::desktopFileName = 0; + QGuiApplicationPrivate::mouse_buttons = Qt::NoButton; + QGuiApplicationPrivate::modifier_buttons = Qt::NoModifier; + QGuiApplicationPrivate::lastCursorPosition = {qInf(), qInf()}; + QGuiApplicationPrivate::currentMousePressWindow = QGuiApplicationPrivate::currentMouseWindow = nullptr; + QGuiApplicationPrivate::applicationState = Qt::ApplicationInactive; + QGuiApplicationPrivate::highDpiScalingUpdated = false; + QGuiApplicationPrivate::tabletDevicePoints.clear(); +#ifndef QT_NO_SESSIONMANAGER + QGuiApplicationPrivate::is_fallback_session_management_enabled = true; +#endif + QGuiApplicationPrivate::mousePressTime = 0; + QGuiApplicationPrivate::mousePressX = QGuiApplicationPrivate::mousePressY = 0; } QGuiApplicationPrivate::QGuiApplicationPrivate(int &argc, char **argv, int flags) @@ -1531,6 +1543,7 @@ QGuiApplicationPrivate::~QGuiApplicationPrivate() delete m_a32ColorProfile.load(); window_list.clear(); + screen_list.clear(); } #if 0