aboutsummaryrefslogtreecommitdiff
path: root/backend/headless/input_device.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-12-15 19:54:25 +0100
committerGitHub <noreply@github.com>2018-12-15 19:54:25 +0100
commit6d4bfa3226123e958ff2bdc4f226489cba49f84d (patch)
tree256c7c3ded68d4b95ed09f7a2fbfd5bc67dbcee9 /backend/headless/input_device.c
parent8a56b96c5516ee089b7561949aac4f83e5b94808 (diff)
parentf8129ecbc5147a62d93d6bac5e61e5ce79d89667 (diff)
Merge pull request #1377 from tokyovigilante/switch-events
Add support for libinput_switch input devices
Diffstat (limited to 'backend/headless/input_device.c')
-rw-r--r--backend/headless/input_device.c8
1 files changed, 8 insertions, 0 deletions
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 <wlr/interfaces/wlr_tablet_pad.h>
#include <wlr/interfaces/wlr_tablet_tool.h>
#include <wlr/interfaces/wlr_touch.h>
+#include <wlr/interfaces/wlr_switch.h>
#include <wlr/util/log.h>
#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);