QGuiApplication: move two static variables from DATA to BSS

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 <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Marc Mutz 2021-08-05 11:56:54 +02:00
parent 8da891a7f4
commit aa25e8d87e

View File

@ -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;