From ad89a83ae6c25f9cac6828e9a2ce5295ca8156ba Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 3 Feb 2026 15:47:57 +1000 Subject: [PATCH] tablet: ignore the tablet tool name if it's a generic tool libwacom has generic pens that are used for devices that don't have tool ids. Let's ignore the names for those pens since they're just made up names anyway. Signed-off-by: Peter Hutterer Part-of: --- meson.build | 4 ++++ src/libinput.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/meson.build b/meson.build index ed26b5dc..7618da3a 100644 --- a/meson.build +++ b/meson.build @@ -223,6 +223,10 @@ if have_libwacom dependencies: dep_libwacom) config_h.set('HAVE_LIBWACOM_BUTTON_MODESWITCH_MODE', '1') endif + if cc.has_function('libwacom_stylus_is_generic', + dependencies: dep_libwacom) + config_h.set('HAVE_LIBWACOM_STYLUS_IS_GENERIC', '1') + endif else dep_libwacom = declare_dependency() endif diff --git a/src/libinput.c b/src/libinput.c index 47c6c6ff..768c8e3e 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -1662,6 +1662,10 @@ libinput_tablet_tool_get_name(struct libinput_tablet_tool *tool) if (!stylus) return NULL; +#ifdef HAVE_LIBWACOM_STYLUS_IS_GENERIC + if (libwacom_stylus_is_generic(stylus)) + return NULL; +#endif return libwacom_stylus_get_name(stylus); #else return NULL;