diff options
author | Simon Ser <contact@emersion.fr> | 2024-03-07 12:16:11 +0100 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2024-03-07 09:53:40 -0500 |
commit | f2a0e81b2438853e12a2b8fe9bddde154852d85d (patch) | |
tree | 9cb5da9be6a8c3d0bc3fcaeacce36ab2e3f4569c /sway/input/input-manager.c | |
parent | config: add fallback without env vars for keysym translation XKB keymap (diff) | |
download | sway-f2a0e81b2438853e12a2b8fe9bddde154852d85d.tar.gz sway-f2a0e81b2438853e12a2b8fe9bddde154852d85d.tar.zst sway-f2a0e81b2438853e12a2b8fe9bddde154852d85d.zip |
Fetch input device vendor/product from libinput
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4582
Diffstat (limited to 'sway/input/input-manager.c')
-rw-r--r-- | sway/input/input-manager.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index 056cc3ea..089e1e71 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c | |||
@@ -65,8 +65,15 @@ struct sway_seat *input_manager_sway_seat_from_wlr_seat(struct wlr_seat *wlr_sea | |||
65 | } | 65 | } |
66 | 66 | ||
67 | char *input_device_get_identifier(struct wlr_input_device *device) { | 67 | char *input_device_get_identifier(struct wlr_input_device *device) { |
68 | int vendor = device->vendor; | 68 | int vendor = 0, product = 0; |
69 | int product = device->product; | 69 | #if WLR_HAS_LIBINPUT_BACKEND |
70 | if (wlr_input_device_is_libinput(device)) { | ||
71 | struct libinput_device *libinput_dev = wlr_libinput_get_device_handle(device); | ||
72 | vendor = libinput_device_get_id_vendor(libinput_dev); | ||
73 | product = libinput_device_get_id_product(libinput_dev); | ||
74 | } | ||
75 | #endif | ||
76 | |||
70 | char *name = strdup(device->name ? device->name : ""); | 77 | char *name = strdup(device->name ? device->name : ""); |
71 | strip_whitespace(name); | 78 | strip_whitespace(name); |
72 | 79 | ||