evdevtouch: fix input_event time related compile

Fixes:

  evdevtouch/qevdevtouchhandler.cpp: In member function ‘void QEvdevTouchScreenData::processInputEvent(input_event*)’:
  evdevtouch/qevdevtouchhandler.cpp:579:29: error: ‘struct input_event’ has no member named ‘time’; did you mean ‘type’?
           m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
                               ^~~~
                               type
  evdevtouch/qevdevtouchhandler.cpp:579:49: error: ‘struct input_event’ has no member named ‘time’; did you mean ‘type’?
           m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
                                                   ^~~~
                                                   type

Task-number: QTBUG-84012
Change-Id: Ib8d726a0baf2bdc85da9341229fffaddc0e373ee
Pick-to: 5.15
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
Peter Seiderer 2020-05-04 23:19:25 +02:00
parent 8cdc9ac5b2
commit 71fb4d081c

View File

@ -58,6 +58,14 @@
#include <linux/input.h>
#endif
#ifndef input_event_sec
#define input_event_sec time.tv_sec
#endif
#ifndef input_event_usec
#define input_event_usec time.tv_usec
#endif
#include <math.h>
#if QT_CONFIG(mtdev)
@ -573,7 +581,7 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
// update timestamps
m_lastTimeStamp = m_timeStamp;
m_timeStamp = data->time.tv_sec + data->time.tv_usec / 1000000.0;
m_timeStamp = data->input_event_sec + data->input_event_usec / 1000000.0;
m_lastTouchPoints = m_touchPoints;
m_touchPoints.clear();