mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
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>
This commit is contained in:
parent
8072ab0a50
commit
9e233e31a2
1 changed files with 5 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue