Skip to content

Commit

Permalink
Allow to match by uniq without name
Browse files Browse the repository at this point in the history
This allows for DeviceMatch=usb:1234:5678||someuniq
  • Loading branch information
JoseExposito authored and whot committed May 7, 2024
1 parent 31f5b7b commit 8211817
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libwacom/libwacom-database.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ make_match_string (const char *name, const char *uniq, WacomBusType bus, int ven
return g_strdup_printf("%s|%04x|%04x%s%s%s%s",
bus_to_str (bus),
vendor_id, product_id,
name ? "|" : "",
(name || uniq) ? "|" : "",
name ? name : "",
uniq ? "|" : "",
uniq ? uniq : "");
Expand Down
4 changes: 4 additions & 0 deletions libwacom/libwacom.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,10 @@ libwacom_new_from_builder(const WacomDeviceDatabase *db, const WacomBuilder *bui
if (device == NULL) {
match_name = NULL;
device = libwacom_new (db, match_name, match_uniq, vendor_id, product_id, *bus, error);
if (device == NULL) {
match_uniq = uniq;
device = libwacom_new (db, match_name, match_uniq, vendor_id, product_id, *bus, error);
}
}
}
if (device)
Expand Down

0 comments on commit 8211817

Please sign in to comment.