From a30e29af2e4d0ad6fc476ae7cc13c4cad5119217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 8 Jan 2014 22:29:20 -0800 Subject: [PATCH] input: Ignore touch up events if num_tp is 0 This can happen if we start out with one or more fingers on the touch screen, in which case we didn't get the corresponding down event. Closes: https://bugs.freedesktop.org/show_bug.cgi?id=73367 --- src/input.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/input.c b/src/input.c index 902cfb8f..157066cc 100644 --- a/src/input.c +++ b/src/input.c @@ -1488,6 +1488,14 @@ notify_touch(struct weston_seat *seat, uint32_t time, int touch_id, grab->interface->motion(grab, time, touch_id, sx, sy); break; case WL_TOUCH_UP: + if (touch->num_tp == 0) { + /* This can happen if we start out with one or + * more fingers on the touch screen, in which + * case we didn't get the corresponding down + * event. */ + weston_log("unmatched touch up event\n"); + break; + } weston_compositor_idle_release(ec); touch->num_tp--;