rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | From 4ba125216b900fc57c63a915fb194c48f4b516c4 Mon Sep 17 00:00:00 2001 |
| 2 | From: Qian Hu <Qian.Hu@mediatek.com> |
| 3 | Date: Tue, 24 Sep 2019 11:26:20 +0800 |
| 4 | Subject: [PATCH 2/8] [PATCH 2/9] libinput: fix issue for touch_event cause |
| 5 | weston crash |
| 6 | |
| 7 | 1.fix touch_event cause weston crash |
| 8 | |
| 9 | Signed-off-by: Qian Hu <Qian.Hu@mediatek.com> |
| 10 | --- |
| 11 | libweston/libinput-device.c | 13 +++++++++++++ |
| 12 | 1 file changed, 13 insertions(+) |
| 13 | |
| 14 | diff --git a/libweston/libinput-device.c b/libweston/libinput-device.c |
| 15 | index 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 | -- |
| 39 | 2.6.4 |
| 40 | |