From cb95dcd4c93c2f6e2ef62d7623f24d1ee955d903 Mon Sep 17 00:00:00 2001 From: Glen Sawyer Date: Sun, 22 May 2022 00:01:24 -0600 Subject: [PATCH] Fix reMarkable crash bug v2022.05: event overwrite with new time module (#9121) The change from timeval to time completely broke reMarkable. frontend/device/remarkable/device.lua was using TimeVal:now() to manually overwrite event time values, as noted in the code comments. Input:handleTouchEv is expecting those event time values to be timevals, not integer times. So as soon as the user touches the screen, crash. --- frontend/device/remarkable/device.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/device/remarkable/device.lua b/frontend/device/remarkable/device.lua index 25a00c700..d49239963 100644 --- a/frontend/device/remarkable/device.lua +++ b/frontend/device/remarkable/device.lua @@ -95,7 +95,11 @@ function Remarkable2:adjustTouchEvent(ev, by) -- Inject CLOCK_MONOTONIC timestamps at the end of every input frame in order to have consistent gesture detection across input devices. -- c.f., #7536 if ev.type == C.EV_SYN and ev.code == C.SYN_REPORT then - ev.time = time.now() + local sec, usec = time.split_s_us(time.now()) + ev.time = { + sec = sec, + usec = usec + } end end