673ca3dbc889602ddf8d941d33c7c2c33b6491ca
[AGL/meta-agl.git] / meta-agl-bsp / meta-ti / recipes-arago / weston / weston / 0004-Weston-Fix-touch-screen-crash-issue.patch
1 From 8958bf21960a475d2933e688d0da9a0d2186d509 Mon Sep 17 00:00:00 2001
2 From: Eric Ruei <e-ruei1@ti.com>
3 Date: Thu, 9 Mar 2017 14:34:18 -0500
4 Subject: [PATCH 4/4] Weston: Fix touch screen crash issue
5
6 Touch screen operation causes the weston to crash with segment fault sometimes.
7 The crash occurs when the coordinate (x,y) passed to the weston input module
8 is outside the view window, hence the weston compositor is not able to pick
9 up a display view and there is no code to detect this condition at function
10 notify_touch().
11
12 Signed-off-by: Eric Ruei <e-ruei1@ti.com>
13 ---
14  src/input.c | 6 ++++++
15  1 file changed, 6 insertions(+)
16
17 diff --git a/src/input.c b/src/input.c
18 index 8fe898c..0f72d23 100644
19 --- a/src/input.c
20 +++ b/src/input.c
21 @@ -1848,6 +1848,12 @@ notify_touch(struct weston_seat *seat, uint32_t time, int touch_id,
22                  * until all touch points are up again. */
23                 if (touch->num_tp == 1) {
24                         ev = weston_compositor_pick_view(ec, x, y, &sx, &sy);
25 +                       if (!ev)
26 +                       {
27 +                               weston_log("notify_touch: weston_compositor_pick_view(%d, %d) failed to find a view!\n",
28 +                                                       wl_fixed_to_int(x), wl_fixed_to_int(y));
29 +                               return;
30 +                       }
31                         weston_touch_set_focus(touch, ev);
32                 } else if (!touch->focus) {
33                         /* Unexpected condition: We have non-initial touch but
34 -- 
35 1.9.1
36