summaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp/meta-ti/recipes-arago/weston/weston/0004-Weston-Fix-touch-screen-crash-issue.patch
blob: ba20551e1e57079c36d7468866de245dd90265ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 8958bf21960a475d2933e688d0da9a0d2186d509 Mon Sep 17 00:00:00 2001
From: Eric Ruei <e-ruei1@ti.com>
Date: Thu, 9 Mar 2017 14:34:18 -0500
Subject: [PATCH 4/4] Weston: Fix touch screen crash issue

Touch screen operation causes the weston to crash with segment fault sometimes.
The crash occurs when the coordinate (x,y) passed to the weston input module
is outside the view window, hence the weston compositor is not able to pick
up a display view and there is no code to detect this condition at function
notify_touch().

Signed-off-by: Eric Ruei <e-ruei1@ti.com>
---
 libweston/input.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libweston/input.c b/libweston/input.c
index 8fe898c..0f72d23 100644
--- a/libweston/input.c
+++ b/libweston/input.c
@@ -1848,6 +1848,12 @@ notify_touch(struct weston_seat *seat, uint32_t time, int touch_id,
 		 * until all touch points are up again. */
 		if (touch->num_tp == 1) {
 			ev = weston_compositor_pick_view(ec, x, y, &sx, &sy);
+			if (!ev)
+			{
+				weston_log("notify_touch: weston_compositor_pick_view(%d, %d) failed to find a view!\n",
+							wl_fixed_to_int(x), wl_fixed_to_int(y));
+				return;
+			}
 			weston_touch_set_focus(touch, ev);
 		} else if (!touch->focus) {
 			/* Unexpected condition: We have non-initial touch but
-- 
1.9.1