[PATCH weston 4/4] Handle wl_output.release
Neil Roberts
neil at linux.intel.com
Mon May 19 10:27:42 PDT 2014
The wl_output.release request is now handled. It just causes the
resource to be destroyed. This is also set as the destructor when
zombifying the resource.
---
src/compositor.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/src/compositor.c b/src/compositor.c
index ea0c9b4..f9bd25b 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -3038,6 +3038,18 @@ weston_compositor_stack_plane(struct weston_compositor *ec,
wl_list_insert(&ec->plane_list, &plane->link);
}
+static void
+output_release(struct wl_client *client,
+ struct wl_resource *resource)
+{
+ wl_resource_destroy(resource);
+}
+
+static struct wl_output_interface
+output_interface = {
+ output_release
+};
+
static void unbind_resource(struct wl_resource *resource)
{
wl_list_remove(wl_resource_get_link(resource));
@@ -3052,14 +3064,15 @@ bind_output(struct wl_client *client,
struct wl_resource *resource;
resource = wl_resource_create(client, &wl_output_interface,
- MIN(version, 2), id);
+ MIN(version, 3), id);
if (resource == NULL) {
wl_client_post_no_memory(client);
return;
}
wl_list_insert(&output->resource_list, wl_resource_get_link(resource));
- wl_resource_set_implementation(resource, NULL, data, unbind_resource);
+ wl_resource_set_implementation(resource, &output_interface,
+ data, unbind_resource);
wl_output_send_geometry(resource,
output->x,
@@ -3159,7 +3172,9 @@ weston_output_destroy(struct weston_output *output)
wl_global_destroy(output->global);
wl_resource_for_each_safe(resource, tmp, &output->resource_list)
- weston_resource_zombify(resource, ~0);
+ weston_resource_zombify(resource,
+ WL_REQUEST_OPCODE(wl_output_interface,
+ release));
}
static void
@@ -3357,7 +3372,7 @@ weston_output_init(struct weston_output *output, struct weston_compositor *c,
output->compositor->output_id_pool |= 1 << output->id;
output->global =
- wl_global_create(c->wl_display, &wl_output_interface, 2,
+ wl_global_create(c->wl_display, &wl_output_interface, 3,
output, bind_output);
wl_signal_emit(&c->output_created_signal, output);
}
--
1.9.0
More information about the wayland-devel
mailing list