blob: 85df38187c5d7b9af59864c0c92b3ea0db0a7927 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001From 411e213e6e87acf027a18cc4db38a27838352c0f Mon Sep 17 00:00:00 2001
2From: Jia Rong <jia.rong@mediatek.com>
3Date: Fri, 20 Apr 2018 10:51:51 +0800
4Subject: [PATCH 2/9] libinput: fix issue for touch_event cause weston crash
5
61.fix touch_event cause weston crash
7Test: test ok
8
9Change-Id: I69bd82ef9c46e97392212b32d599c7fbb3fbb3f5
10Signed-off-by: Jia Rong <jia.rong@mediatek.com>
11CR-Id: AUTO00016576
12---
13 libweston/libinput-device.c | 12 ++++++++++++
14 1 file changed, 12 insertions(+)
15
16diff --git a/libweston/libinput-device.c b/libweston/libinput-device.c
17index f97afcf..031148c 100644
18--- a/libweston/libinput-device.c
19+++ b/libweston/libinput-device.c
20@@ -312,6 +312,18 @@ handle_touch_with_coords(struct libinput_device *libinput_device,
21 x = libinput_event_touch_get_x_transformed(touch_event, width);
22 y = libinput_event_touch_get_y_transformed(touch_event, height);
23
24+ if (x == 0)
25+ x = x + 1;
26+
27+ if (y == 0)
28+ y = y + 1;
29+
30+ if (x == wl_fixed_from_int(width))
31+ x = x - 1;
32+
33+ if (y == wl_fixed_from_int(height))
34+ y = y - 1;
35+
36 weston_output_transform_coordinate(device->output,
37 x, y, &x, &y);
38
39--
401.9.1
41