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 2, 2025
1 parent 47f27a3 commit 290c1ec
Show file tree
Hide file tree
Showing 2 changed files with 7 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
2 changes: 2 additions & 0 deletions src/core/seat/pointing-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ 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 @@ -165,6 +166,7 @@ void wf::pointing_device_t::update_options()
libinput_device_config_3fg_drag_set_enabled(dev,
LIBINPUT_CONFIG_3FG_DRAG_ENABLED_4FG);
}
#endif

if (libinput_device_config_scroll_has_natural_scroll(dev) > 0)
{
Expand Down

0 comments on commit 290c1ec

Please sign in to comment.