summaryrefslogtreecommitdiff
path: root/tools/list-local-devices.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2021-03-19 13:47:58 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2021-03-19 13:55:34 +1000
commit342a7af8e378b43924b5287bca183621cc52e2f6 (patch)
tree6a8632f65af74ef9d3312508eb6567cd62fa530d /tools/list-local-devices.c
parent1f37865bbd242ff057b425945b18359ff8f86e59 (diff)
downloadlibwacom-342a7af8e378b43924b5287bca183621cc52e2f6.tar.gz
tools: print known tablets that are not supported by libwacom
Instead of letting the user guess, check the ID_INPUT_TABLET udev property and print an explicit error message for unsupported devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools/list-local-devices.c')
-rw-r--r--tools/list-local-devices.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/tools/list-local-devices.c b/tools/list-local-devices.c
index 77f9180..2017860 100644
--- a/tools/list-local-devices.c
+++ b/tools/list-local-devices.c
@@ -36,6 +36,7 @@
#include <dirent.h>
#include <glib/gi18n.h>
#include <glib.h>
+#include <gudev/gudev.h>
#include "libwacom.h"
static enum output_format {
@@ -106,6 +107,25 @@ tablet_print_oneline(gpointer data, gpointer user_data)
printf("\n");
}
+static void
+check_if_udev_tablet(const char *path)
+{
+ GUdevClient *client;
+ GUdevDevice *device;
+ const char * const subsystems[] = { "input", NULL };
+
+ client = g_udev_client_new (subsystems);
+ device = g_udev_client_query_by_device_file (client, path);
+ if (device &&
+ g_udev_device_get_property_as_boolean (device, "ID_INPUT_TABLET")) {
+ fprintf(stderr,
+ "%s is a tablet but not supported by libwacom\n",
+ path);
+ }
+ g_object_unref (device);
+ g_object_unref (client);
+}
+
static gboolean
check_format(const gchar *option_name, const gchar *value, gpointer data, GError **error)
{
@@ -178,8 +198,10 @@ int main(int argc, char **argv)
snprintf(fname, sizeof(fname), "/dev/input/%s", filename);
dev = libwacom_new_from_path(db, fname, WFALLBACK_NONE, NULL);
- if (!dev)
+ if (!dev) {
+ check_if_udev_tablet(fname);
continue;
+ }
found = g_list_find_custom(tabletlist, dev, tablet_compare);
if (found) {