diff options
Diffstat (limited to 'backend/headless')
-rw-r--r-- | backend/headless/backend.c | 5 | ||||
-rw-r--r-- | backend/headless/input_device.c | 8 |
2 files changed, 7 insertions, 6 deletions
diff --git a/backend/headless/backend.c b/backend/headless/backend.c index 886be276..ad0c4ebf 100644 --- a/backend/headless/backend.c +++ b/backend/headless/backend.c @@ -33,8 +33,7 @@ static bool backend_start(struct wlr_backend *wlr_backend) { } struct wlr_headless_input_device *input_device; - wl_list_for_each(input_device, &backend->input_devices, - wlr_input_device.link) { + wl_list_for_each(input_device, &backend->input_devices, link) { wlr_signal_emit_safe(&backend->backend.events.new_input, &input_device->wlr_input_device); } @@ -59,7 +58,7 @@ static void backend_destroy(struct wlr_backend *wlr_backend) { struct wlr_headless_input_device *input_device, *input_device_tmp; wl_list_for_each_safe(input_device, input_device_tmp, - &backend->input_devices, wlr_input_device.link) { + &backend->input_devices, link) { wlr_input_device_destroy(&input_device->wlr_input_device); } diff --git a/backend/headless/input_device.c b/backend/headless/input_device.c index 1d91f8d1..4df01aff 100644 --- a/backend/headless/input_device.c +++ b/backend/headless/input_device.c @@ -12,8 +12,10 @@ #include "util/signal.h" static void input_device_destroy(struct wlr_input_device *wlr_dev) { - wl_list_remove(&wlr_dev->link); - free(wlr_dev); + struct wlr_headless_input_device *dev = + wl_container_of(wlr_dev, dev, wlr_input_device); + wl_list_remove(&dev->link); + free(dev); } static const struct wlr_input_device_impl input_device_impl = { @@ -93,7 +95,7 @@ struct wlr_input_device *wlr_headless_add_input_device( wlr_switch_init(wlr_device->switch_device, NULL); } - wl_list_insert(&backend->input_devices, &wlr_device->link); + wl_list_insert(&backend->input_devices, &device->link); if (backend->started) { wlr_signal_emit_safe(&backend->backend.events.new_input, wlr_device); |