From aa25e8d87e1392459fc5de511798356cb5b5f7cb Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 5 Aug 2021 11:56:54 +0200 Subject: [PATCH] QGuiApplication: move two static variables from DATA to BSS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The {mouse,touch}DoubleXDistance variables were initialized to -1, which forces them into the DATA segments. But this value is completely unused, since these variables are also set in initThemeHints(), called from QGuiApplicationPrivate::init(), before their only user, QGuiApplicationPrivate::processMouseEvent(), can possibly execute. By changing the default value to 0, then, we allow the compiler to place these variables into the BSS segment. Change-Id: I86144559ee2410b844f70a4f2499c8d3140d14cf Reviewed-by: Edward Welbourne Reviewed-by: MÃ¥rten Nordheim --- src/gui/kernel/qguiapplication.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 55a7c8027b..b1e4c0e882 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -179,8 +179,8 @@ QPalette *QGuiApplicationPrivate::app_pal = nullptr; // default applicati Qt::MouseButton QGuiApplicationPrivate::mousePressButton = Qt::NoButton; -static int mouseDoubleClickDistance = -1; -static int touchDoubleTapDistance = -1; +static int mouseDoubleClickDistance = 0; +static int touchDoubleTapDistance = 0; QWindow *QGuiApplicationPrivate::currentMousePressWindow = nullptr;