[PATCH 1/5] compositor: Implement release request for input interfaces

Kristian Høgsberg krh at bitplanet.net
Mon Feb 25 18:33:21 PST 2013


---
 src/compositor.c | 36 ++++++++++++++++++++++++++++++++----
 1 file changed, 32 insertions(+), 4 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index 5ff68d7..e965648 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2243,8 +2243,15 @@ pointer_set_cursor(struct wl_client *client, struct wl_resource *resource,
 		pointer_cursor_surface_configure(surface, 0, 0);
 }
 
+static void
+pointer_release(struct wl_client *client, struct wl_resource *resource)
+{
+	wl_resource_destroy(resource);
+}
+
 static const struct wl_pointer_interface pointer_interface = {
-	pointer_set_cursor
+	pointer_set_cursor,
+	pointer_release
 };
 
 static void
@@ -2298,6 +2305,16 @@ seat_get_pointer(struct wl_client *client, struct wl_resource *resource,
 }
 
 static void
+keyboard_release(struct wl_client *client, struct wl_resource *resource)
+{
+	wl_resource_destroy(resource);
+}
+
+static const struct wl_keyboard_interface keyboard_interface = {
+	keyboard_release
+};
+
+static void
 seat_get_keyboard(struct wl_client *client, struct wl_resource *resource,
 		  uint32_t id)
 {
@@ -2307,8 +2324,8 @@ seat_get_keyboard(struct wl_client *client, struct wl_resource *resource,
 	if (!seat->seat.keyboard)
 		return;
 
-        cr = wl_client_add_object(client, &wl_keyboard_interface, NULL, id,
-				  seat);
+        cr = wl_client_add_object(client, &wl_keyboard_interface,
+				  &keyboard_interface, id, seat);
 	wl_list_insert(&seat->seat.keyboard->resource_list, &cr->link);
 	cr->destroy = unbind_resource;
 
@@ -2325,6 +2342,16 @@ seat_get_keyboard(struct wl_client *client, struct wl_resource *resource,
 }
 
 static void
+touch_release(struct wl_client *client, struct wl_resource *resource)
+{
+	wl_resource_destroy(resource);
+}
+
+static const struct wl_touch_interface touch_interface = {
+	touch_release
+};
+
+static void
 seat_get_touch(struct wl_client *client, struct wl_resource *resource,
 	       uint32_t id)
 {
@@ -2334,7 +2361,8 @@ seat_get_touch(struct wl_client *client, struct wl_resource *resource,
 	if (!seat->seat.touch)
 		return;
 
-        cr = wl_client_add_object(client, &wl_touch_interface, NULL, id, seat);
+        cr = wl_client_add_object(client, &wl_touch_interface,
+				  &touch_interface, id, seat);
 	wl_list_insert(&seat->seat.touch->resource_list, &cr->link);
 	cr->destroy = unbind_resource;
 }
-- 
1.8.1.2



More information about the wayland-devel mailing list