From 8dbdefb77a7ec9343aa5fd0700dd9a430164ad0a Mon Sep 17 00:00:00 2001
From: Sergey Bugaev <bugaevc@gmail.com>
Date: Sun, 20 Aug 2023 13:13:13 +0300
Subject: [PATCH 2/2] Tweak binding interfaces further

- Also check for wl_seat version
- Fix parenthesizing in a macro
---
 src/types/registry.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/types/registry.c b/src/types/registry.c
index e1ea2c0..1c7ad99 100644
--- a/src/types/registry.c
+++ b/src/types/registry.c
@@ -29,7 +29,7 @@
 
 #define BIND(interface_name, known_version) \
 if (strcmp(interface, #interface_name) == 0) { \
-    if (version >= known_version) { \
+    if (version >= (known_version)) { \
         self->interface_name = wl_registry_bind( \
             wl_registry, \
             name, \
@@ -83,7 +83,7 @@ static void wl_registry_global_handler(
     BIND(zwlr_data_control_manager_v1, version > 2 ? 2 : version)
 #endif
 
-    if (strcmp(interface, "wl_seat") == 0) {
+    if (strcmp(interface, "wl_seat") == 0 && version >= 2) {
         struct seat *seat = calloc(1, sizeof(struct seat));
         seat->proxy = wl_registry_bind(
             wl_registry,
-- 
2.42.0

