[PATCH weston 4/6] input: Reset pointer state when last pointer device was removed

Jonas Ådahl jadahl at gmail.com
Mon Dec 2 13:05:05 PST 2013


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

Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
---
 src/input.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/input.c b/src/input.c
index 34aa720..01eafc2 100644
--- a/src/input.c
+++ b/src/input.c
@@ -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);
 	}
 }
-- 
1.8.1.2



More information about the wayland-devel mailing list