input: Reset pointer state when last pointer device was removed

Reset pointer button count in case the driver did not emit appropriate
number of number button released events.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
This commit is contained in:
Jonas Ådahl 2013-12-02 22:05:05 +01:00 committed by Kristian Høgsberg
parent cbfa7f7b22
commit 3e12e63f03
1 changed files with 7 additions and 0 deletions

View File

@ -431,6 +431,12 @@ pointer_handle_sprite_destroy(struct wl_listener *listener, void *data)
pointer->sprite = NULL;
}
static void
weston_pointer_reset_state(struct weston_pointer *pointer)
{
pointer->button_count = 0;
}
WL_EXPORT struct weston_pointer *
weston_pointer_create(struct weston_seat *seat)
{
@ -2013,6 +2019,7 @@ weston_seat_release_pointer(struct weston_seat *seat)
if (pointer->sprite)
pointer_unmap_sprite(pointer);
weston_pointer_reset_state(pointer);
seat_send_updated_caps(seat);
}
}