[PATCH weston] input: Destroy the pointer when the last device is unplugged

Derek Foreman derekf at osg.samsung.com
Tue Jan 6 17:51:43 PST 2015


Removing the last device that provides a pointer now destroys the
pointer struct and sets it to NULL (so things like zoom don't use
the old co-ordinates)

Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
---
 src/input.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/input.c b/src/input.c
index d3bfa5e..ec5ee08 100644
--- a/src/input.c
+++ b/src/input.c
@@ -2221,11 +2221,9 @@ weston_seat_release_pointer(struct weston_seat *seat)
 					 wl_fixed_from_int(0));
 		weston_pointer_cancel_grab(pointer);
 
-		if (pointer->sprite)
-			pointer_unmap_sprite(pointer);
-
-		weston_pointer_reset_state(pointer);
 		seat_send_updated_caps(seat);
+		weston_pointer_destroy(pointer);
+		seat->pointer = NULL;
 	}
 }
 
-- 
2.1.4



More information about the wayland-devel mailing list