backend/libinput: add devices wl_list

This commit prepares the ground for a wlr_libinput_input_device refactoring.
This commit is contained in:
Simon Zeni 2022-02-22 16:17:48 -05:00 committed by Kirill Primak
parent 0a5a65cf48
commit 9dd6e2b905
3 changed files with 21 additions and 2 deletions

View file

@ -224,6 +224,16 @@ static void handle_device_removed(struct wlr_libinput_backend *backend,
int product = libinput_device_get_id_product(libinput_dev);
const char *name = libinput_device_get_name(libinput_dev);
wlr_log(WLR_DEBUG, "Removing %s [%d:%d]", name, vendor, product);
if (!wl_list_empty(&backend->devices)) {
struct wlr_libinput_input_device *dev, *tmp_dev;
wl_list_for_each_safe(dev, tmp_dev, &backend->devices, link) {
if (dev->handle == libinput_dev) {
destroy_libinput_input_device(dev);
}
}
}
if (!wlr_devices) {
return;
}