mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
input-device: remove wlr_input_device.link
This field's ownership is unclear: it's in wlr_input_device, but it's not managed by the common code, it's up to each individual backend to use it and clean it up. Since this is a backend implementation detail, move it to the backend-specific structs.
This commit is contained in:
parent
c9ba9e82b6
commit
1d9c1bcea6
11 changed files with 44 additions and 44 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue