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
This commit is contained in:
Wei Wei 2023-09-26 15:58:48 +08:00 committed by yan wang
parent 1c733f69b6
commit d98c1e513a
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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);
};