Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Device information ... not found" errors with modern libwacom versions #69

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ocumo
Copy link

@ocumo ocumo commented Jul 30, 2023

This PR fixes #68, by adding compatibility with libwacom >= 1.10, while maintaining compatibility with older versions.

This fixes wacom-gui compatibility with:

  • Ubuntu: >= 22.04 LTS
  • Debian: >= 12 (bookworm) (i.e. the current version)
  • Fedora >= 36
  • CentOS >= 9
  • Arch
  • Gentoo

In particular, I've tested this on Ubuntu 22.04 LTS. By the way, the necessary dependencies for Ubuntu are: libwacom-bin, xserver-xorg-input-wacom, python3-pyqt5, python3-pyqt5.qtsvg in case you want to add them to the README. libwacom-bin is the Ubuntu and Debian equivalent to libwacom in RPM systems, e.g. libwacom-2.7.0-1.fc38.x86_64.rpm for Fedora 38.

Israel Eduardo Lugo added 2 commits July 30, 2023 19:54
Depending on how old the version of libwacom, most likely no devices will
ever be detected. libwacom-list-local-devices, since April 28, 2021
(release 1.10, see ref. below) uses the YAML format by default, which
looks like:

```
$ libwacom-list-local-devices --database /usr/share/libwacom/
devices:
- name: 'Wacom Intuos Pro L'
  bus: 'usb'
  vid: '0x056a'
  pid: '0x0317'
  nodes:
  - /dev/input/event30
  - /dev/input/event29
  - /dev/input/event28
```
...while wacom-gui expects a different format, thus the parsing is wrong,
and the 'detected' dictionary in get_connected_tablets() is wrong and an
exception is thrown.
To get the format expected by wacom-gui, we need to add the
`--format=datafile` argument.
In addition, we are quoting the '%s' to avoid an exception in a case where
the path would have spaces.

NOTE: this change breaks compatibility with libwacom < 1.10.

See libwacom's project commit referenced below.

References:
- libwacom commit
linuxwacom/libwacom@68c0ba5
"tools: use a YAML-compatible format by default"
 - https://github.com/linuxwacom/libwacom/releases/tag/libwacom-1.10
libwacom 1.10 introduced a breaking change to the output format of
libwacom-list-local-devices. Commit a480df1 makes us compatible with the
new format, at the expense of breaking compatibility with older versions.

This commit reintroduces compatibility with BOTH versions. The strategy is
to first try running libwacom-list-local-devices with the new syntax, and
fall back to the old syntax if necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Device information ... not found" errors with modern libwacom versions
1 participant