From bc3b39bde331bc673f3b5b60a9f048c91c4f7dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Mon, 20 Sep 2021 19:46:45 +0200 Subject: [PATCH] build: check if libinput supports high-res scroll Add a project argument (LIBINPUT_HAS_SCROLL_VALUE120) to allow building against old versions of libinput or, where high-resolution scroll is available, support it. --- backend/libinput/meson.build | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/backend/libinput/meson.build b/backend/libinput/meson.build index 44bb57e19..65175b149 100644 --- a/backend/libinput/meson.build +++ b/backend/libinput/meson.build @@ -27,3 +27,14 @@ wlr_files += files( features += { 'libinput-backend': true } wlr_deps += libinput + +# Check whether libinput supports high-resolution scroll or not +libinput_supports_scroll_value120 = cc.has_function( + 'libinput_event_pointer_get_scroll_value_v120', + dependencies: libinput, +) + +add_project_arguments( + '-DLIBINPUT_HAS_SCROLL_VALUE120=@0@'.format(libinput_supports_scroll_value120.to_int()), + language: 'c', +)