diff options
author | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-01-31 10:53:58 -0500 |
---|---|---|
committer | Kirill Primak <vyivel@eclair.cafe> | 2022-02-21 17:11:32 +0000 |
commit | 0f3b38365d07bb3e65b5ce2ec265453115276d1d (patch) | |
tree | f427995f384fd7fca1d1289cfdb067a92138afa8 /backend/libinput | |
parent | d5480efc7a03641600df411dea93308e5edc8b27 (diff) |
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.
Diffstat (limited to 'backend/libinput')
-rw-r--r-- | backend/libinput/switch.c | 7 |
1 files changed, 5 insertions, 2 deletions
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; } |