clients/simple-dmabuf-feedback: fix bound global versions
It's invalid for a client to pass the compositor's supported version directly to wl_registry_bind. For instance, under wlroots the client will bind to wl_output version 4 and crash because it doesn't handle the new "name" event. Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
@@ -1268,7 +1268,7 @@ registry_handle_global(void *data, struct wl_registry *registry,
|
|||||||
} else if (strcmp(interface, "wl_output") == 0) {
|
} else if (strcmp(interface, "wl_output") == 0) {
|
||||||
d->output.wl_output = wl_registry_bind(registry, id,
|
d->output.wl_output = wl_registry_bind(registry, id,
|
||||||
&wl_output_interface,
|
&wl_output_interface,
|
||||||
version);
|
MIN(version, 3));
|
||||||
wl_output_add_listener(d->output.wl_output,
|
wl_output_add_listener(d->output.wl_output,
|
||||||
&output_listener, &d->output);
|
&output_listener, &d->output);
|
||||||
} else if (strcmp(interface, "zwp_linux_dmabuf_v1") == 0) {
|
} else if (strcmp(interface, "zwp_linux_dmabuf_v1") == 0) {
|
||||||
@@ -1276,7 +1276,7 @@ registry_handle_global(void *data, struct wl_registry *registry,
|
|||||||
return;
|
return;
|
||||||
d->dmabuf = wl_registry_bind(registry, id,
|
d->dmabuf = wl_registry_bind(registry, id,
|
||||||
&zwp_linux_dmabuf_v1_interface,
|
&zwp_linux_dmabuf_v1_interface,
|
||||||
version);
|
MIN(version, 4));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user