summaryrefslogtreecommitdiff
path: root/tools/synclient.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-03-18 18:38:12 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-03-23 16:45:48 +1000
commita07a840b26827e1a2c8cccd255177b693c5b91e8 (patch)
tree88fc4aa8dcab3f2c60837fd05437ddd3e857c68e /tools/synclient.c
parentea7695037070e7037a4b20db87dd466c643ac088 (diff)
Don't fail when building against server 1.5
The driver had all the right guards, but synclient and syndaemon didn't. Check for xserver 1.6 and higher and disable property support in synclient and syndaemon. Note that the property headers still get installed even without support for properties in the driver. This ensures that apps looking for synaptics >= thisversion don't fail miserably. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Christoph Brill <egore@gmx.de>
Diffstat (limited to 'tools/synclient.c')
-rw-r--r--tools/synclient.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/tools/synclient.c b/tools/synclient.c
index 40279d4..82ce61b 100644
--- a/tools/synclient.c
+++ b/tools/synclient.c
@@ -45,11 +45,13 @@
#include <X11/extensions/XInput.h>
#include "synaptics.h"
#include "synaptics-properties.h"
+#ifdef HAVE_PROPERTIES
#include <xserver-properties.h>
#ifndef XATOM_FLOAT
#define XATOM_FLOAT "FLOAT"
#endif
+#endif
enum ParaType {
PT_INT,
@@ -397,6 +399,7 @@ shm_init()
}
+#ifdef HAVE_PROPERTIES
/** Init display connection or NULL on error */
static Display*
dp_init()
@@ -665,12 +668,15 @@ dp_show_settings(Display *dpy, XDevice *dev)
XFree(data);
}
}
+#endif
static void
usage(void)
{
fprintf(stderr, "Usage: synclient [-s] [-m interval] [-h] [-l] [-V] [-?] [var1=value1 [var2=value2] ...]\n");
+#ifdef HAVE_PROPERTIES
fprintf(stderr, " -s Use SHM area instead of device properties.\n");
+#endif
fprintf(stderr, " -m monitor changes to the touchpad state (implies -s)\n"
" interval specifies how often (in ms) to poll the touchpad state\n");
fprintf(stderr, " -h Show detected hardware properties (implies -s)\n");
@@ -689,9 +695,13 @@ main(int argc, char *argv[])
int do_monitor = 0;
int dump_hw = 0;
int dump_settings = 0;
- int use_shm = 0;
+ int use_shm = 1;
int first_cmd;
+#ifdef HAVE_PROPERTIES
+ use_shm = 0;
+#endif
+
/* Parse command line parameters */
while ((c = getopt(argc, argv, "sm:hlV")) != -1) {
switch (c) {
@@ -718,6 +728,7 @@ main(int argc, char *argv[])
usage();
}
}
+
first_cmd = optind;
if (!do_monitor && !dump_hw && !dump_settings && first_cmd == argc)
usage();
@@ -741,7 +752,9 @@ main(int argc, char *argv[])
shm_show_settings(synshm);
if (do_monitor)
shm_monitor(synshm, delay);
- } else /* Device properties */
+ }
+#ifdef HAVE_PROPERTIES
+ else /* Device properties */
{
Display *dpy;
XDevice *dev;
@@ -757,6 +770,7 @@ main(int argc, char *argv[])
XCloseDevice(dpy, dev);
XCloseDisplay(dpy);
}
+#endif
return 0;
}