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

Commits on Jul 30, 2023

  1. Fix failures with libwacom >= 1.10

    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
    Israel Eduardo Lugo committed Jul 30, 2023
    Configuration menu
    Copy the full SHA
    a480df1 View commit details
    Browse the repository at this point in the history
  2. Be compatible with both old and versions of libwacom

    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.
    Israel Eduardo Lugo committed Jul 30, 2023
    Configuration menu
    Copy the full SHA
    6de2d66 View commit details
    Browse the repository at this point in the history