rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | From 411e213e6e87acf027a18cc4db38a27838352c0f Mon Sep 17 00:00:00 2001 |
| 2 | From: Jia Rong <jia.rong@mediatek.com> |
| 3 | Date: Fri, 20 Apr 2018 10:51:51 +0800 |
| 4 | Subject: [PATCH 2/9] libinput: fix issue for touch_event cause weston crash |
| 5 | |
| 6 | 1.fix touch_event cause weston crash |
| 7 | Test: test ok |
| 8 | |
| 9 | Change-Id: I69bd82ef9c46e97392212b32d599c7fbb3fbb3f5 |
| 10 | Signed-off-by: Jia Rong <jia.rong@mediatek.com> |
| 11 | CR-Id: AUTO00016576 |
| 12 | --- |
| 13 | libweston/libinput-device.c | 12 ++++++++++++ |
| 14 | 1 file changed, 12 insertions(+) |
| 15 | |
| 16 | diff --git a/libweston/libinput-device.c b/libweston/libinput-device.c |
| 17 | index 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 | -- |
| 40 | 1.9.1 |
| 41 | |