From eaa77c1d2edf9aca263b888c237197bacaa49576 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Mon, 20 Sep 2021 19:46:31 +0200 Subject: [PATCH] Read event before trying to access it --- libinput_multi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libinput_multi.c b/libinput_multi.c index 26216be..ca5fe60 100644 --- a/libinput_multi.c +++ b/libinput_multi.c @@ -189,11 +189,11 @@ void libinput_multi_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data) switch (type) { case LIBINPUT_EVENT_TOUCH_MOTION: case LIBINPUT_EVENT_TOUCH_DOWN: { + touch_event = libinput_event_get_touch_event(event); lv_coord_t y = libinput_event_touch_get_y_transformed(touch_event, full_display_height); if (y < display_y_offset) { break; /* ignore touches that are out of bounds */ } - touch_event = libinput_event_get_touch_event(event); most_recent_touch_point.x = libinput_event_touch_get_x_transformed(touch_event, LV_HOR_RES); most_recent_touch_point.y = y; state->button = LV_INDEV_STATE_PR;