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/ipc-json.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sway/ipc-json.c') diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 73a3d376..8aa9557e 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include @@ -21,6 +21,10 @@ #include "wlr-layer-shell-unstable-v1-protocol.h" #include "sway/desktop/idle_inhibit_v1.h" +#if WLR_HAS_LIBINPUT_BACKEND +#include +#endif + static const int i3_output_id = INT32_MAX; static const int i3_scratch_id = INT32_MAX - 1; @@ -847,6 +851,7 @@ json_object *ipc_json_describe_node_recursive(struct sway_node *node) { return object; } +#if WLR_HAS_LIBINPUT_BACKEND static json_object *describe_libinput_device(struct libinput_device *device) { json_object *object = json_object_new_object(); @@ -1052,6 +1057,7 @@ static json_object *describe_libinput_device(struct libinput_device *device) { return object; } +#endif json_object *ipc_json_describe_input(struct sway_input_device *device) { if (!(sway_assert(device, "Device must not be null"))) { @@ -1115,12 +1121,14 @@ json_object *ipc_json_describe_input(struct sway_input_device *device) { json_object_new_double(scroll_factor)); } +#if WLR_HAS_LIBINPUT_BACKEND if (wlr_input_device_is_libinput(device->wlr_device)) { struct libinput_device *libinput_dev; libinput_dev = wlr_libinput_get_device_handle(device->wlr_device); json_object_object_add(object, "libinput", describe_libinput_device(libinput_dev)); } +#endif return object; } -- cgit v1.2.3-54-g00ecf