diff options
author | Simon Ser <contact@emersion.fr> | 2022-11-26 20:18:43 +0100 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-11-28 13:28:15 -0500 |
commit | e62299daa45de139b912325eb5800796586e57c7 (patch) | |
tree | 5a1972d97bd65000f8e328667f2a772c8622e9e8 /sway/commands/input | |
parent | 46170580b2ca7c2d484f9095f1ecd92c0a4ac04f (diff) |
Make libinput backend optional
Diffstat (limited to 'sway/commands/input')
-rw-r--r-- | sway/commands/input/events.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sway/commands/input/events.c b/sway/commands/input/events.c index 9405181a..08d99bf0 100644 --- a/sway/commands/input/events.c +++ b/sway/commands/input/events.c @@ -1,14 +1,19 @@ #include <limits.h> #include <string.h> #include <strings.h> -#include <wlr/backend/libinput.h> +#include <wlr/config.h> #include "sway/config.h" #include "sway/commands.h" #include "sway/input/input-manager.h" #include "log.h" +#if WLR_HAS_LIBINPUT_BACKEND +#include <wlr/backend/libinput.h> +#endif + static void toggle_supported_send_events_for_device(struct input_config *ic, struct sway_input_device *input_device) { +#if WLR_HAS_LIBINPUT_BACKEND struct wlr_input_device *wlr_device = input_device->wlr_device; if (!wlr_input_device_is_libinput(wlr_device)) { return; @@ -41,6 +46,7 @@ static void toggle_supported_send_events_for_device(struct input_config *ic, } ic->send_events = mode; +#endif } static int mode_for_name(const char *name) { @@ -56,6 +62,7 @@ static int mode_for_name(const char *name) { static void toggle_select_send_events_for_device(struct input_config *ic, struct sway_input_device *input_device, int argc, char **argv) { +#if WLR_HAS_LIBINPUT_BACKEND if (!wlr_input_device_is_libinput(input_device->wlr_device)) { return; } @@ -72,6 +79,7 @@ static void toggle_select_send_events_for_device(struct input_config *ic, } } ic->send_events = mode_for_name(argv[index % argc]); +#endif } static void toggle_send_events(int argc, char **argv) { |