From d98c1e513a8ec4fb32ac580037f6a9feec430776 Mon Sep 17 00:00:00 2001 From: Wei Wei Date: Tue, 26 Sep 2023 15:58:48 +0800 Subject: [PATCH] fix: if XInputExtension isn't present, hasTouchpadOnX11() should return false hasTouchpadOnX11() return false when cann't find TouchPad from XInput so if XInputExtension isn't present, hasTouchpadOnX11() should return false not true --- src/touchpad-settings/touchpaddevicehelper.cpp | 6 +++--- src/touchpad-settings/touchpaddevicehelper.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/touchpad-settings/touchpaddevicehelper.cpp b/src/touchpad-settings/touchpaddevicehelper.cpp index ae9ee56..4fe4fe8 100644 --- a/src/touchpad-settings/touchpaddevicehelper.cpp +++ b/src/touchpad-settings/touchpaddevicehelper.cpp @@ -25,8 +25,8 @@ bool TouchpadDeviceHelper::hasTouchpadOnX11() int devicesNum; bool result; - if (supportsXinputDevices() == false) { - return true; + if (!supportXinputExtension()) { + return false; } deviceInfo = XListInputDevices(QX11Info::display(), &devicesNum); @@ -51,7 +51,7 @@ bool TouchpadDeviceHelper::hasTouchpadOnX11() return result; } -bool TouchpadDeviceHelper::supportsXinputDevices() +bool TouchpadDeviceHelper::supportXinputExtension() { int op_code, event, error; diff --git a/src/touchpad-settings/touchpaddevicehelper.h b/src/touchpad-settings/touchpaddevicehelper.h index 0b539f8..3455d4e 100644 --- a/src/touchpad-settings/touchpaddevicehelper.h +++ b/src/touchpad-settings/touchpaddevicehelper.h @@ -20,7 +20,7 @@ private: static bool hasTouchpadOnX11(); static XDevice* deviceIsTouchpad(XDeviceInfo* deviceinfo); - static bool supportsXinputDevices(); + static bool supportXinputExtension(); static bool deviceHasProperty(XDevice *device, const char *property_name); };