From 0f3b38365d07bb3e65b5ce2ec265453115276d1d Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Mon, 31 Jan 2022 10:53:58 -0500 Subject: types/wlr_switch: add base wlr_input_device wlr_switch owns its wlr_input_device. It will be initialized when the switch is initialized, and finished when the switch is destroyed. --- backend/libinput/switch.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'backend/libinput/switch.c') diff --git a/backend/libinput/switch.c b/backend/libinput/switch.c index a9c33d3a..9562e185 100644 --- a/backend/libinput/switch.c +++ b/backend/libinput/switch.c @@ -16,8 +16,11 @@ struct wlr_switch *create_libinput_switch( wlr_log(WLR_ERROR, "Unable to allocate wlr_switch"); return NULL; } - wlr_switch_init(wlr_switch, NULL); - wlr_log(WLR_DEBUG, "Created switch for device %s", libinput_device_get_name(libinput_dev)); + const char *name = libinput_device_get_name(libinput_dev); + wlr_switch_init(wlr_switch, NULL, name); + wlr_log(WLR_DEBUG, "Created switch for device %s", name); + wlr_switch->base.vendor = libinput_device_get_id_vendor(libinput_dev); + wlr_switch->base.product = libinput_device_get_id_product(libinput_dev); return wlr_switch; } -- cgit v1.2.3