diff options
author | Jari Ronkainen <ronchaine@gmail.com> | 2021-10-08 19:18:21 +0300 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-10-08 19:09:42 +0200 |
commit | 624ffa45162d7df1ae0796b283bef2f4a0d6a0d7 (patch) | |
tree | 00914b364fe810f26e3d7f6edccf963ccbb42511 /sway | |
parent | 83310f5abf1fd9937a9f734da4015aacd54fd112 (diff) |
Improve built-in touchscreen detection
Adds detection code to handle pci-*-platform-* strings
in ID_PATH
References: https://github.com/swaywm/sway/issues/6590
Signed-off-by: Jari Ronkainen <ronchaine@gmail.com>
Diffstat (limited to 'sway')
-rw-r--r-- | sway/input/libinput.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sway/input/libinput.c b/sway/input/libinput.c index 060a584a..3c0f359d 100644 --- a/sway/input/libinput.c +++ b/sway/input/libinput.c @@ -332,6 +332,13 @@ bool sway_libinput_device_is_builtin(struct sway_input_device *sway_device) { return false; } - const char prefix[] = "platform-"; - return strncmp(id_path, prefix, strlen(prefix)) == 0; + const char prefix_platform[] = "platform-"; + if (strncmp(id_path, prefix_platform, strlen(prefix_platform)) != 0) { + return false; + } + + const char prefix_pci[] = "pci-"; + const char infix_platform[] = "-platform-"; + return (strncmp(id_path, prefix_pci, strlen(prefix_pci)) == 0) && + strstr(id_path, infix_platform); } |