0005-evdevkeyboard-fix-input_event-time-related-compile.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. From e3821efb37d64d599760b82beac024804188b824 Mon Sep 17 00:00:00 2001
  2. From: Peter Seiderer <ps.report@gmx.net>
  3. Date: Mon, 4 May 2020 23:17:45 +0200
  4. Subject: [PATCH] evdevkeyboard: fix input_event time related compile
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Fixes:
  9. evdevkeyboard/qevdevkeyboardhandler.cpp: In member function ‘void QEvdevKeyboardHandler::switchLed(int, bool)’:
  10. evdevkeyboard/qevdevkeyboardhandler.cpp:153:28: error: ‘struct input_event’ has no member named ‘time’; did you mean ‘type’?
  11. ::gettimeofday(&led_ie.time, 0);
  12. ^~~~
  13. type
  14. Signed-off-by: Peter Seiderer <ps.report@gmx.net>
  15. Upstream: https://github.com/qt/qtbase/commit/c5b8b662105cc5ced968da9f567fe1134c52d6b5
  16. ---
  17. .../input/evdevkeyboard/qevdevkeyboardhandler.cpp | 13 ++++++++++++-
  18. 1 file changed, 12 insertions(+), 1 deletion(-)
  19. diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
  20. index 3555763b..de37f5e2 100644
  21. --- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
  22. +++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
  23. @@ -58,6 +58,14 @@
  24. #include <linux/input.h>
  25. #endif
  26. +#ifndef input_event_sec
  27. +#define input_event_sec time.tv_sec
  28. +#endif
  29. +
  30. +#ifndef input_event_usec
  31. +#define input_event_usec time.tv_usec
  32. +#endif
  33. +
  34. QT_BEGIN_NAMESPACE
  35. Q_LOGGING_CATEGORY(qLcEvdevKey, "qt.qpa.input")
  36. @@ -149,8 +157,11 @@ void QEvdevKeyboardHandler::switchLed(int led, bool state)
  37. {
  38. qCDebug(qLcEvdevKey, "switchLed %d %d", led, int(state));
  39. + struct timeval tv;
  40. + ::gettimeofday(&tv, 0);
  41. struct ::input_event led_ie;
  42. - ::gettimeofday(&led_ie.time, 0);
  43. + led_ie.input_event_sec = tv.tv_sec;
  44. + led_ie.input_event_usec = tv.tv_usec;
  45. led_ie.type = EV_LED;
  46. led_ie.code = led;
  47. led_ie.value = state;
  48. --
  49. 2.26.2