forked from external/yambar
module/foreign-toplevel: require version 3 of wl-output interface
The bar itself already does this, and doing so means we can always use wl_output_release() (instead of wl_output_destroy()).
This commit is contained in:
parent
589a6f528a
commit
9681e0aabe
1 changed files with 4 additions and 11 deletions
|
@ -29,7 +29,6 @@ struct output {
|
||||||
struct zxdg_output_v1 *xdg_output;
|
struct zxdg_output_v1 *xdg_output;
|
||||||
|
|
||||||
char *name;
|
char *name;
|
||||||
bool use_output_release;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct toplevel {
|
struct toplevel {
|
||||||
|
@ -64,12 +63,8 @@ output_free(struct output *output)
|
||||||
free(output->name);
|
free(output->name);
|
||||||
if (output->xdg_output != NULL)
|
if (output->xdg_output != NULL)
|
||||||
zxdg_output_v1_destroy(output->xdg_output);
|
zxdg_output_v1_destroy(output->xdg_output);
|
||||||
if (output->wl_output != NULL) {
|
if (output->wl_output != NULL)
|
||||||
if (output->use_output_release)
|
wl_output_release(output->wl_output);
|
||||||
wl_output_release(output->wl_output);
|
|
||||||
else
|
|
||||||
wl_output_destroy(output->wl_output);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -468,7 +463,7 @@ handle_global(void *data, struct wl_registry *registry,
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (strcmp(interface, wl_output_interface.name) == 0) {
|
else if (strcmp(interface, wl_output_interface.name) == 0) {
|
||||||
const uint32_t required = 1;
|
const uint32_t required = 3;
|
||||||
if (!verify_iface_version(interface, version, required))
|
if (!verify_iface_version(interface, version, required))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -476,9 +471,7 @@ handle_global(void *data, struct wl_registry *registry,
|
||||||
.mod = mod,
|
.mod = mod,
|
||||||
.wl_name = name,
|
.wl_name = name,
|
||||||
.wl_output = wl_registry_bind(
|
.wl_output = wl_registry_bind(
|
||||||
registry, name,
|
registry, name, &wl_output_interface, required),
|
||||||
&wl_output_interface, min(version, WL_OUTPUT_RELEASE_SINCE_VERSION)),
|
|
||||||
.use_output_release = version >= WL_OUTPUT_RELEASE_SINCE_VERSION,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
mtx_lock(&mod->lock);
|
mtx_lock(&mod->lock);
|
||||||
|
|
Loading…
Add table
Reference in a new issue