diff --git a/meson.build b/meson.build index 82fe0681e..8f31983a7 100644 --- a/meson.build +++ b/meson.build @@ -153,6 +153,11 @@ if cpp.has_argument('-fno-gnu-unique') endif add_project_arguments(project_args, language: ['cpp', 'c']) +# Compile new libinput features only if they are supported with the libinput installed version +if cpp.has_function('libinput_device_config_3fg_drag_set_enabled', dependencies: libinput) + add_project_arguments('-DHAVE_LIBINPUT_3FG_DRAG=1', language : ['cpp', 'c']) +endif + # Needed on some older compilers if cpp.has_link_argument('-lc++fs') add_project_link_arguments(['-lc++fs'], language: 'cpp') diff --git a/src/core/seat/pointing-device.cpp b/src/core/seat/pointing-device.cpp index f385edaf1..bdb1f153d 100644 --- a/src/core/seat/pointing-device.cpp +++ b/src/core/seat/pointing-device.cpp @@ -148,6 +148,8 @@ void wf::pointing_device_t::update_options() LIBINPUT_CONFIG_DRAG_LOCK_ENABLED : LIBINPUT_CONFIG_DRAG_LOCK_DISABLED); +#if HAVE_LIBINPUT_3FG_DRAG + if ((std::string)touchpad_3fg_drag == "default") { libinput_device_config_3fg_drag_set_enabled(dev, @@ -166,6 +168,8 @@ void wf::pointing_device_t::update_options() LIBINPUT_CONFIG_3FG_DRAG_ENABLED_4FG); } +#endif + if (libinput_device_config_scroll_has_natural_scroll(dev) > 0) { libinput_device_config_scroll_set_natural_scroll_enabled(dev,