Skip to content

Commit

Permalink
Compile 3-finger drag feature only if it is supported by installed li…
Browse files Browse the repository at this point in the history
…binput version
  • Loading branch information
jihem-el committed Mar 3, 2025
1 parent 47f27a3 commit 6b8aaca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
4 changes: 4 additions & 0 deletions src/core/seat/pointing-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 6b8aaca

Please sign in to comment.