summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-11-21 16:57:31 +0100
committerDaniel Stone <daniels@collabora.com>2024-01-19 15:12:29 +0000
commit9e233e31a21b0f58639c261d4dd4d72caa0bbd66 (patch)
treec98fe401284a5b0c5a1abaa77a0c9fc676f5a2b8
parent8072ab0a505d8aeb7b34d3ecd297ca501979d905 (diff)
shm: fix resource versions
This was hardcoded to 1 regardless of the version passed to the callback or the version of the parent resource. Signed-off-by: Simon Ser <contact@emersion.fr>
-rw-r--r--src/wayland-shm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/wayland-shm.c b/src/wayland-shm.c
index 8fb657a..1938644 100644
--- a/src/wayland-shm.c
+++ b/src/wayland-shm.c
@@ -310,6 +310,7 @@ shm_create_pool(struct wl_client *client, struct wl_resource *resource,
int seals;
int prot;
int flags;
+ uint32_t version;
if (size <= 0) {
wl_resource_post_error(resource,
@@ -358,8 +359,10 @@ shm_create_pool(struct wl_client *client, struct wl_resource *resource,
#else
close(fd);
#endif
+
+ version = wl_resource_get_version(resource);
pool->resource =
- wl_resource_create(client, &wl_shm_pool_interface, 1, id);
+ wl_resource_create(client, &wl_shm_pool_interface, version, id);
if (!pool->resource) {
wl_client_post_no_memory(client);
munmap(pool->data, pool->size);
@@ -392,7 +395,7 @@ bind_shm(struct wl_client *client,
struct wl_array *additional_formats;
uint32_t *p;
- resource = wl_resource_create(client, &wl_shm_interface, 1, id);
+ resource = wl_resource_create(client, &wl_shm_interface, version, id);
if (!resource) {
wl_client_post_no_memory(client);
return;