From 3bd99fb9c93da89564d31cf6579d49213915d2f7 Mon Sep 17 00:00:00 2001 From: Dennis Field Date: Fri, 11 Nov 2016 11:10:04 -0500 Subject: [PATCH] Fix Weston crash on touchscreen input Check for touch->focus before using it, as some touchscreens will generate out-of-screen coordinates and cause touch->focus to be NULL. (e.g. Raspberry Pi display, some displays after weston-calibrator) Bug-AGL: SPEC-309 Upstream-Status: Backport [https://cgit.freedesktop.org/wayland/weston/commit/src/input.c?id=2c40d1d30eabe46706822a8b5c94579aeba58e84] Change-Id: I01b5cf7fd95275290544dffba2771619b1488dff Signed-off-by: Dennis Field --- .../wayland/weston/fix-touchscreen-crash.patch | 29 ++++++++++++++++++++++ .../recipes-graphics/wayland/weston_%.bbappend | 1 + 2 files changed, 30 insertions(+) create mode 100644 meta-agl/recipes-graphics/wayland/weston/fix-touchscreen-crash.patch diff --git a/meta-agl/recipes-graphics/wayland/weston/fix-touchscreen-crash.patch b/meta-agl/recipes-graphics/wayland/weston/fix-touchscreen-crash.patch new file mode 100644 index 000000000..71b41accf --- /dev/null +++ b/meta-agl/recipes-graphics/wayland/weston/fix-touchscreen-crash.patch @@ -0,0 +1,29 @@ +Fix Weston crash on touchscreen input + +Check for touch->focus before using it, as some touchscreens will generate +out-of-screen coordinates and cause touch->focus to be NULL. (e.g. Raspberry Pi +display, some displays after weston-calibrator) + +Bug-AGL: SPEC-309 + +Upstream-Status: Backport [https://cgit.freedesktop.org/wayland/weston/commit/src/input.c?id=2c40d1d30eabe46706822a8b5c94579aeba58e84] +=================================================== +--- a/src/input.c 2015-09-14 14:23:28.000000000 -0400 ++++ b/src/input.c 2016-11-09 16:06:28.371959318 -0500 +@@ -245,11 +245,14 @@ + struct wl_list *resource_list; + wl_fixed_t sx, sy; + ++ if (!touch->focus) ++ return; ++ + weston_view_from_global_fixed(touch->focus, x, y, &sx, &sy); + + resource_list = &touch->focus_resource_list; + +- if (!wl_list_empty(resource_list) && touch->focus) { ++ if (!wl_list_empty(resource_list)) { + serial = wl_display_next_serial(display); + wl_resource_for_each(resource, resource_list) + wl_touch_send_down(resource, serial, time, + diff --git a/meta-agl/recipes-graphics/wayland/weston_%.bbappend b/meta-agl/recipes-graphics/wayland/weston_%.bbappend index 95b886c6e..573b481a9 100644 --- a/meta-agl/recipes-graphics/wayland/weston_%.bbappend +++ b/meta-agl/recipes-graphics/wayland/weston_%.bbappend @@ -4,6 +4,7 @@ SRC_URI_append = "\ file://0001-compositor-drm.c-Launch-without-input-devices.patch \ file://weston.service \ file://weston.ini \ + file://fix-touchscreen-crash.patch \ " inherit systemd -- 2.16.6