From 2a3c62b4d28ec7a69473e9c18c42f1ed26c74bbf Mon Sep 17 00:00:00 2001 From: Ryan Walklin Date: Wed, 14 Nov 2018 23:24:55 +0000 Subject: [WIP][DONTMERGE]Add support for libinput_switch input devices These are used primarily by laptops to signal the state of the lid (open/closed) and tablet mode if supported, based on ACPI events. --- backend/headless/input_device.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'backend/headless/input_device.c') diff --git a/backend/headless/input_device.c b/backend/headless/input_device.c index ba251dd7..827c6ee4 100644 --- a/backend/headless/input_device.c +++ b/backend/headless/input_device.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "backend/headless.h" #include "util/signal.h" @@ -76,6 +77,13 @@ struct wlr_input_device *wlr_headless_add_input_device( } wlr_tablet_pad_init(wlr_device->tablet_pad, NULL); break; + case WLR_INPUT_DEVICE_SWITCH: + wlr_device->lid_switch = calloc(1, sizeof(struct wlr_switch)); + if (wlr_device->lid_switch == NULL) { + wlr_log(WLR_ERROR, "Unable to allocate wlr_switch"); + goto error; + } + wlr_switch_init(wlr_device->lid_switch, NULL); } wl_list_insert(&backend->input_devices, &wlr_device->link); -- cgit v1.2.3