blob: 85df38187c5d7b9af59864c0c92b3ea0db0a7927 [file] [log] [blame]
From 411e213e6e87acf027a18cc4db38a27838352c0f Mon Sep 17 00:00:00 2001
From: Jia Rong <jia.rong@mediatek.com>
Date: Fri, 20 Apr 2018 10:51:51 +0800
Subject: [PATCH 2/9] libinput: fix issue for touch_event cause weston crash
1.fix touch_event cause weston crash
Test: test ok
Change-Id: I69bd82ef9c46e97392212b32d599c7fbb3fbb3f5
Signed-off-by: Jia Rong <jia.rong@mediatek.com>
CR-Id: AUTO00016576
---
libweston/libinput-device.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/libweston/libinput-device.c b/libweston/libinput-device.c
index f97afcf..031148c 100644
--- a/libweston/libinput-device.c
+++ b/libweston/libinput-device.c
@@ -312,6 +312,18 @@ 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);
--
1.9.1