aboutsummaryrefslogtreecommitdiff
path: root/backend/headless
diff options
context:
space:
mode:
authorRoman Gilg <subdiff@gmail.com>2021-11-14 18:37:36 +0100
committerRoman Gilg <subdiff@gmail.com>2021-11-15 12:49:26 +0100
commit8274c85d21df4c790b46666f4383731c89352480 (patch)
tree2c331c9ed2484bc73925f6068459b11c1387d6f2 /backend/headless
parent4a8e681a5fa82d59544fbdb8026f1606c41504e2 (diff)
backend/headless: unlink input device on destroy
Removing an input device requires unlinking it from the list of all headless input devices. For that implement a destroy function.
Diffstat (limited to 'backend/headless')
-rw-r--r--backend/headless/input_device.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/backend/headless/input_device.c b/backend/headless/input_device.c
index 76e69c52..1d91f8d1 100644
--- a/backend/headless/input_device.c
+++ b/backend/headless/input_device.c
@@ -11,7 +11,14 @@
#include "backend/headless.h"
#include "util/signal.h"
-static const struct wlr_input_device_impl input_device_impl = { 0 };
+static void input_device_destroy(struct wlr_input_device *wlr_dev) {
+ wl_list_remove(&wlr_dev->link);
+ free(wlr_dev);
+}
+
+static const struct wlr_input_device_impl input_device_impl = {
+ .destroy = input_device_destroy,
+};
bool wlr_input_device_is_headless(struct wlr_input_device *wlr_dev) {
return wlr_dev->impl == &input_device_impl;