Use wl_resource_create() for creating resources
This commit sets the version numbers for all added/created objects. The
wl_compositor.create_surface implementation was altered to create a surface
with the same version as the underlying wl_compositor. Since no other
"child interfaces" have version greater than 1, they were all hard-coded to
version 1.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
diff --git a/src/screenshooter.c b/src/screenshooter.c
index 8143202..f236ca4 100644
--- a/src/screenshooter.c
+++ b/src/screenshooter.c
@@ -217,14 +217,17 @@
struct screenshooter *shooter = data;
struct wl_resource *resource;
- resource = wl_client_add_object(client, &screenshooter_interface,
- &screenshooter_implementation, id, data);
+ resource = wl_resource_create(client,
+ &screenshooter_interface, 1, id);
if (client != shooter->client) {
wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
"screenshooter failed: permission denied");
wl_resource_destroy(resource);
}
+
+ wl_resource_set_implementation(resource, &screenshooter_implementation,
+ data, NULL);
}
static void