From e62299daa45de139b912325eb5800796586e57c7 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 26 Nov 2022 20:18:43 +0100 Subject: Make libinput backend optional --- sway/commands/input/events.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sway/commands') 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 #include #include -#include +#include #include "sway/config.h" #include "sway/commands.h" #include "sway/input/input-manager.h" #include "log.h" +#if WLR_HAS_LIBINPUT_BACKEND +#include +#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) { -- cgit v1.2.3