aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-01-06 20:25:06 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-01-06 20:25:06 +0000
commite37edba3876df82de0a526dbc266641a44089a90 (patch)
treee1cc686502a76c301ba50f2c597923275f2e9872
parentMerge branch 'argc-is-zero' (diff)
parentwayland: don’t try to bind wl_output version 4 unconditionally (diff)
Merge branch 'wl-output-version-4'
Closes #876
-rw-r--r--wayland.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/wayland.c b/wayland.c
index 61e2dfdf..d58fdc40 100644
--- a/wayland.c
+++ b/wayland.c
@@ -996,8 +996,16 @@ handle_global(void *data, struct wl_registry *registry,
if (!verify_iface_version(interface, version, required))
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(
- wayl->registry, name, &wl_output_interface, min(version, 4));
+ wayl->registry, name, &wl_output_interface, min(version, preferred));
tll_push_back(
wayl->monitors,