[PATCH wayland 2/2] wayland-server: Add destroy signal to wl_seat

Jonas Ådahl jadahl at gmail.com
Tue Jun 12 14:57:33 PDT 2012


Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
---
 src/wayland-server.c |    4 ++++
 src/wayland-server.h |    1 +
 2 files changed, 5 insertions(+)

diff --git a/src/wayland-server.c b/src/wayland-server.c
index fb4e157..75f7e1f 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -622,6 +622,8 @@ wl_seat_init(struct wl_seat *seat)
 {
 	memset(seat, 0, sizeof *seat);
 
+	wl_signal_init(&seat->destroy_signal);
+
 	seat->selection_data_source = NULL;
 	wl_list_init(&seat->base_resource_list);
 	wl_signal_init(&seat->selection_signal);
@@ -632,6 +634,8 @@ wl_seat_init(struct wl_seat *seat)
 WL_EXPORT void
 wl_seat_release(struct wl_seat *seat)
 {
+	wl_signal_emit(&seat->destroy_signal, seat);
+
 	if (seat->pointer)
 		wl_pointer_release(seat->pointer);
 	if (seat->keyboard)
diff --git a/src/wayland-server.h b/src/wayland-server.h
index a447c6d..a7bc7b4 100644
--- a/src/wayland-server.h
+++ b/src/wayland-server.h
@@ -294,6 +294,7 @@ struct wl_touch {
 
 struct wl_seat {
 	struct wl_list base_resource_list;
+	struct wl_signal destroy_signal;
 
 	struct wl_pointer *pointer;
 	struct wl_keyboard *keyboard;
-- 
1.7.9.5



More information about the wayland-devel mailing list