mirror of
https://github.com/X11Libre/xf86-input-synaptics.git
synced 2026-03-24 09:44:40 +00:00
syndaemon: don't compare against a null-property. (#37459)
synaptics_property is not set, touchpad_off_prop is the property we need to check against. False check for (nprops != 0) instead of (nprops < 0) would result in syndaemon always reporting a touchpad device, even if none are present. X.Org Bug 37459 <http://bugs.freedesktop.org/show_bug.cgi?id=37459> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
@@ -465,7 +465,6 @@ dp_get_device(Display *dpy)
|
||||
XDeviceInfo *info = NULL;
|
||||
int ndevices = 0;
|
||||
Atom touchpad_type = 0;
|
||||
Atom synaptics_property = 0;
|
||||
Atom *properties = NULL;
|
||||
int nprops = 0;
|
||||
int error = 0;
|
||||
@@ -495,10 +494,10 @@ dp_get_device(Display *dpy)
|
||||
|
||||
while(nprops--)
|
||||
{
|
||||
if (properties[nprops] == synaptics_property)
|
||||
if (properties[nprops] == touchpad_off_prop)
|
||||
break;
|
||||
}
|
||||
if (!nprops)
|
||||
if (nprops < 0)
|
||||
{
|
||||
fprintf(stderr, "No synaptics properties on device '%s'.\n",
|
||||
info[ndevices].name);
|
||||
|
||||
Reference in New Issue
Block a user