mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-20 05:33:47 -04:00
wayland: don’t try to bind wl_output version 4 unconditionally
The compositor may offer version 4, while we’re still linked against an old libwayland that does not implement version 4. While we properly #ifdef the callbacks from version 4, we were still requesting version 4 (if offered by the compositor), even when compiled against a too old libwayland. Closes #876
This commit is contained in:
parent
99ebff5a51
commit
ccf9c0fe29
1 changed files with 9 additions and 1 deletions
10
wayland.c
10
wayland.c
|
|
@ -996,8 +996,16 @@ handle_global(void *data, struct wl_registry *registry,
|
||||||
if (!verify_iface_version(interface, version, required))
|
if (!verify_iface_version(interface, version, required))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#if defined(WL_OUTPUT_NAME_SINCE_VERSION)
|
||||||
|
const uint32_t preferred = WL_OUTPUT_NAME_SINCE_VERSION;
|
||||||
|
#elif defined(WL_OUTPUT_RELEASE_SINCE_VERSION)
|
||||||
|
const uint32_t preferred = WL_OUTPUT_RELEASE_SINCE_VERSION;
|
||||||
|
#else
|
||||||
|
const uint32_t preferred = required;
|
||||||
|
#endif
|
||||||
|
|
||||||
struct wl_output *output = wl_registry_bind(
|
struct wl_output *output = wl_registry_bind(
|
||||||
wayl->registry, name, &wl_output_interface, min(version, 4));
|
wayl->registry, name, &wl_output_interface, min(version, preferred));
|
||||||
|
|
||||||
tll_push_back(
|
tll_push_back(
|
||||||
wayl->monitors,
|
wayl->monitors,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue