diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-05-23 10:18:22 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-06-28 14:43:48 +1000 |
commit | 65c8d5c703b2f9a65e3bf86b1ad35a0d439b46aa (patch) | |
tree | 95be4f83103042f1b3de879c6ab3814dfbb2e2b4 | |
parent | 11b70094aa66a85bc06e5c160cdc15139df94cb7 (diff) |
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>
(cherry picked from commit be83094bd98c353b0ee7894eefcb1ae91e0cae30)
-rw-r--r-- | tools/syndaemon.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/syndaemon.c b/tools/syndaemon.c index 327f479..6e62dc5 100644 --- a/tools/syndaemon.c +++ b/tools/syndaemon.c @@ -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); |