From 51018f19d0a07b609058644cb0673ad8e85dab33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Fri, 10 Jun 2022 15:46:24 +0200 Subject: [PATCH] Wayland: Use named constants for version checks The wayland-scanner output provides really nice, self-documenting version macros, so we should use them whenever possible. (cherry picked from commit ed39ff43f969b54ba4659293dfaf4d6948f07fed) --- src/wl_init.c | 4 +++- src/wl_window.c | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wl_init.c b/src/wl_init.c index 25d2cb2f..95fd064d 100644 --- a/src/wl_init.c +++ b/src/wl_init.c @@ -434,8 +434,10 @@ int _glfwPlatformInit(void) _glfwInitTimerPOSIX(); - if (_glfw.wl.seatVersion >= 4) +#ifdef WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION + if (_glfw.wl.seatVersion >= WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION) _glfw.wl.timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK); +#endif if (!_glfw.wl.wmBase) { diff --git a/src/wl_window.c b/src/wl_window.c index d8fb0c90..3578568f 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -387,8 +387,7 @@ static void resizeWindow(_GLFWwindow* window) static void checkScaleChange(_GLFWwindow* window) { - // Check if we will be able to set the buffer scale or not. - if (_glfw.wl.compositorVersion < 3) + if (_glfw.wl.compositorVersion < WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION) return; // Get the scale factor from the highest scale monitor.