diff options
Diffstat (limited to 'recipes-qt/qt5/qtbase/0017-input-Make-use-of-timeval-portable-for-64bit-time_t.patch')
-rw-r--r-- | recipes-qt/qt5/qtbase/0017-input-Make-use-of-timeval-portable-for-64bit-time_t.patch | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/recipes-qt/qt5/qtbase/0017-input-Make-use-of-timeval-portable-for-64bit-time_t.patch b/recipes-qt/qt5/qtbase/0017-input-Make-use-of-timeval-portable-for-64bit-time_t.patch deleted file mode 100644 index 341be6ad..00000000 --- a/recipes-qt/qt5/qtbase/0017-input-Make-use-of-timeval-portable-for-64bit-time_t.patch +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | From 8e9c933cad3bd044b432b5557cf47a9ffea4e318 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 25 Nov 2019 08:27:39 -0800 | ||
4 | Subject: [PATCH] input: Make use of timeval portable for 64bit time_t | ||
5 | |||
6 | This patch avoids using time field of input_event structure which is not available | ||
7 | on 32bit arches supporting 64bit time_t structs, Patch makes it compatible with new | ||
8 | and keeps old input.h implementation functional as well. | ||
9 | |||
10 | See https://sourceware.org/glibc/wiki/Y2038ProofnessDesign | ||
11 | Upstream-Status: Submitted [https://codereview.qt-project.org/c/qt/qtbase/+/282610] | ||
12 | Change-Id: Ie4d66a5e7d83065f1a904a542c711431e1d20845 | ||
13 | --- | ||
14 | .../input/evdevkeyboard/qevdevkeyboardhandler.cpp | 10 +++++++++- | ||
15 | .../input/evdevtouch/qevdevtouchhandler.cpp | 7 ++++++- | ||
16 | 2 files changed, 15 insertions(+), 2 deletions(-) | ||
17 | |||
18 | diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp | ||
19 | index 3555763b89..e7dc57c027 100644 | ||
20 | --- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp | ||
21 | +++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp | ||
22 | @@ -58,6 +58,11 @@ | ||
23 | #include <linux/input.h> | ||
24 | #endif | ||
25 | |||
26 | +#ifndef input_event_sec | ||
27 | +#define input_event_sec time.tv_sec | ||
28 | +#define input_event_usec time.tv_usec | ||
29 | +#endif | ||
30 | + | ||
31 | QT_BEGIN_NAMESPACE | ||
32 | |||
33 | Q_LOGGING_CATEGORY(qLcEvdevKey, "qt.qpa.input") | ||
34 | @@ -150,7 +155,10 @@ void QEvdevKeyboardHandler::switchLed(int led, bool state) | ||
35 | qCDebug(qLcEvdevKey, "switchLed %d %d", led, int(state)); | ||
36 | |||
37 | struct ::input_event led_ie; | ||
38 | - ::gettimeofday(&led_ie.time, 0); | ||
39 | + struct timeval tval; | ||
40 | + ::gettimeofday(&tval, 0); | ||
41 | + led_ie.input_event_sec = tval.tv_sec; | ||
42 | + led_ie.input_event_usec = tval.tv_usec; | ||
43 | led_ie.type = EV_LED; | ||
44 | led_ie.code = led; | ||
45 | led_ie.value = state; | ||
46 | diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp | ||
47 | index 78728ef4ce..1d65f9b9f7 100644 | ||
48 | --- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp | ||
49 | +++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp | ||
50 | @@ -58,6 +58,11 @@ | ||
51 | #include <linux/input.h> | ||
52 | #endif | ||
53 | |||
54 | +#ifndef input_event_sec | ||
55 | +#define input_event_sec time.tv_sec | ||
56 | +#define input_event_usec time.tv_usec | ||
57 | +#endif | ||
58 | + | ||
59 | #include <math.h> | ||
60 | |||
61 | #if QT_CONFIG(mtdev) | ||
62 | @@ -573,7 +578,7 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data) | ||
63 | |||
64 | // update timestamps | ||
65 | m_lastTimeStamp = m_timeStamp; | ||
66 | - m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0; | ||
67 | + m_timeStamp = data->input_event_sec + data->input_event_usec / 1000000.0; | ||
68 | |||
69 | m_lastTouchPoints = m_touchPoints; | ||
70 | m_touchPoints.clear(); | ||