From cbfa7f7b22170daffcbdc9f7634aa6a212f3056b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20=C3=85dahl?= Date: Mon, 2 Dec 2013 22:05:04 +0100 Subject: [PATCH] input: Reset touch state when last touch device was removed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reset the touch point count in case the driver did not emit appropriate number of touch up events. Signed-off-by: Jonas Ådahl --- src/input.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/input.c b/src/input.c index 1b8dbae..34aa720 100644 --- a/src/input.c +++ b/src/input.c @@ -517,6 +517,12 @@ weston_keyboard_destroy(struct weston_keyboard *keyboard) free(keyboard); } +static void +weston_touch_reset_state(struct weston_touch *touch) +{ + touch->num_tp = 0; +} + WL_EXPORT struct weston_touch * weston_touch_create(void) { @@ -2041,6 +2047,7 @@ weston_seat_release_touch(struct weston_seat *seat) if (seat->touch_device_count == 0) { weston_touch_set_focus(seat, NULL); weston_touch_cancel_grab(seat->touch); + weston_touch_reset_state(seat->touch); seat_send_updated_caps(seat); } } -- 2.7.4