blob: cf86044e48b92f695ced01cff1c3f6a746c09551 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001From 4ba125216b900fc57c63a915fb194c48f4b516c4 Mon Sep 17 00:00:00 2001
2From: Qian Hu <Qian.Hu@mediatek.com>
3Date: Tue, 24 Sep 2019 11:26:20 +0800
4Subject: [PATCH 2/8] [PATCH 2/9] libinput: fix issue for touch_event cause
5 weston crash
6
71.fix touch_event cause weston crash
8
9Signed-off-by: Qian Hu <Qian.Hu@mediatek.com>
10---
11 libweston/libinput-device.c | 13 +++++++++++++
12 1 file changed, 13 insertions(+)
13
14diff --git a/libweston/libinput-device.c b/libweston/libinput-device.c
15index e25df14..18a3032 100644
16--- a/libweston/libinput-device.c
17+++ b/libweston/libinput-device.c
18@@ -436,6 +436,19 @@ handle_touch_with_coords(struct libinput_device *libinput_device,
19 x = libinput_event_touch_get_x_transformed(touch_event, width);
20 y = libinput_event_touch_get_y_transformed(touch_event, height);
21
22+ if (x == 0)
23+ x = x + 1;
24+
25+ if (y == 0)
26+ y = y + 1;
27+
28+ if (x == wl_fixed_from_int(width))
29+ x = x - 1;
30+
31+ if (y == wl_fixed_from_int(height))
32+ y = y - 1;
33+
34+
35 weston_output_transform_coordinate(device->output,
36 x, y, &x, &y);
37
38--
392.6.4
40