From f32bcfd51617369052e3377ec45da7b4799e5f68 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 14 Jun 2020 14:27:19 +0200 Subject: [PATCH] Mouse add-one: Fix touchpads detection. The "touchpad" string is part of the path, not of the device name. Regression introduced in hrev53835. --- src/add-ons/input_server/devices/mouse/MouseInputDevice.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/add-ons/input_server/devices/mouse/MouseInputDevice.cpp b/src/add-ons/input_server/devices/mouse/MouseInputDevice.cpp index 1aea626bd8..e4960d3452 100644 --- a/src/add-ons/input_server/devices/mouse/MouseInputDevice.cpp +++ b/src/add-ons/input_server/devices/mouse/MouseInputDevice.cpp @@ -323,7 +323,10 @@ MouseDevice::_BuildShortName() const else name.Capitalize(); - if (deviceName.FindFirst("touchpad") >= 0) { + // Check the whole string for "touchpad" because it's a different directory + // FIXME use MS_IS_TOUCHPAD ioctl instead (or fIsTouchpad which caches its + // result) but this can only be done after the control thread is running + if (string.FindFirst("touchpad") >= 0) { name << " Touchpad "; } else if (deviceName.FindFirst("trackpoint") >= 0) { // That's always PS/2, so don't keep the bus name