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

Assume .tablet files shadow any ones with the same name #831

Merged
merged 1 commit into from
Nov 10, 2024

Conversation

whot
Copy link
Member

@whot whot commented Nov 8, 2024

Commit 2dc213c introduced a duplicate resolution to fix #379 so that we could have a tablet file in /etc/libwacom that had a DeviceMatch that partially overlapped with a DeviceMatch in /usr/share/libwacom, e.g. in this setup:
DeviceMatch=usb|1234|abcd;bluetooth|1234|abcd
DeviceMatch=usb|1234|abcd

This triggered a bug: during the duplicate resolution the device match was removed from the currently parsed file, leading to the file having no device matches which triggered a g_warn_if_reached().

This approach is too complicated and likely unnecessary, use a more conventional approach where a named file hide the same file in any other datadir, i.e. /etc/libwacom/foo-bar.tablet will hide /usr/share/libwacom/foo-bar.tablet, the latter of which will not be parsed at all.

This corresponds to how e.g. system handles service files and many other components in the stack work with a similar approach.

Reverts commit 2dc213c ("libwacom: allow for duplicates across data directories")

Commit 2dc213c introduced a duplicate resolution to fix linuxwacom#379 so
that we could have a tablet file in /etc/libwacom that had a DeviceMatch
that partially overlapped with a DeviceMatch in /usr/share/libwacom,
e.g. in this setup:
  DeviceMatch=usb|1234|abcd;bluetooth|1234|abcd
  DeviceMatch=usb|1234|abcd

This triggered a bug: during the duplicate resolution the device match
was removed from the currently parsed file, leading to the file having
no device matches which triggered a g_warn_if_reached().

This approach is too complicated and likely unnecessary, use a more
conventional approach where a named file hides the same file in any
other datadir, i.e. /etc/libwacom/foo-bar.tablet will hide
/usr/share/libwacom/foo-bar.tablet, the latter of which will not be
parsed at all.

This matches how e.g. system handles service files and many other
components in the stack work with a similar approach.

Reverts commit 2dc213c ("libwacom: allow for duplicates across data directories")
@whot whot force-pushed the wip/disallow-duplicates branch from cec5366 to 211badc Compare November 10, 2024 23:36
@whot whot merged commit 7070531 into linuxwacom:master Nov 10, 2024
18 checks passed
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.

not all Huion H950Ps use the same Device ID
1 participant