| From 4ba125216b900fc57c63a915fb194c48f4b516c4 Mon Sep 17 00:00:00 2001 |
| From: Qian Hu <Qian.Hu@mediatek.com> |
| Date: Tue, 24 Sep 2019 11:26:20 +0800 |
| Subject: [PATCH 2/8] [PATCH 2/9] libinput: fix issue for touch_event cause |
| weston crash |
| |
| 1.fix touch_event cause weston crash |
| |
| Signed-off-by: Qian Hu <Qian.Hu@mediatek.com> |
| --- |
| libweston/libinput-device.c | 13 +++++++++++++ |
| 1 file changed, 13 insertions(+) |
| |
| diff --git a/libweston/libinput-device.c b/libweston/libinput-device.c |
| index e25df14..18a3032 100644 |
| --- a/libweston/libinput-device.c |
| +++ b/libweston/libinput-device.c |
| @@ -436,6 +436,19 @@ handle_touch_with_coords(struct libinput_device *libinput_device, |
| x = libinput_event_touch_get_x_transformed(touch_event, width); |
| y = libinput_event_touch_get_y_transformed(touch_event, height); |
| |
| + if (x == 0) |
| + x = x + 1; |
| + |
| + if (y == 0) |
| + y = y + 1; |
| + |
| + if (x == wl_fixed_from_int(width)) |
| + x = x - 1; |
| + |
| + if (y == wl_fixed_from_int(height)) |
| + y = y - 1; |
| + |
| + |
| weston_output_transform_coordinate(device->output, |
| x, y, &x, &y); |
| |
| -- |
| 2.6.4 |
| |