screencopy: Set upper bounds on protocol version
parent
346d4b50fc
commit
743cfe18b3
|
@ -47,7 +47,6 @@ struct screencopy {
|
|||
|
||||
struct zwlr_screencopy_manager_v1* manager;
|
||||
struct zwlr_screencopy_frame_v1* frame;
|
||||
int version;
|
||||
|
||||
void* userdata;
|
||||
void (*on_done)(struct screencopy*);
|
||||
|
|
|
@ -161,8 +161,7 @@ static void registry_add(void* data, struct wl_registry* registry,
|
|||
self->screencopy.manager =
|
||||
wl_registry_bind(registry, id,
|
||||
&zwlr_screencopy_manager_v1_interface,
|
||||
version);
|
||||
self->screencopy.version = version;
|
||||
MIN(3, version));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -130,7 +130,8 @@ static void screencopy_buffer(void* data,
|
|||
self->wl_shm_height = height;
|
||||
self->wl_shm_stride = stride;
|
||||
|
||||
if (self->version < 3) {
|
||||
int version = zwlr_screencopy_manager_v1_get_version(self->manager);
|
||||
if (version < 3) {
|
||||
self->have_linux_dmabuf = false;
|
||||
screencopy_buffer_done(data, frame);
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue