[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-input-synaptics: Changes to 'upstream'



 configure.ac       |    7 +++++++
 man/synaptics.man  |    6 ++++++
 src/eventcomm.c    |   21 ++++++++++++++++++++-
 src/ps2comm.c      |    7 +++++--
 src/synaptics.c    |   43 +++++++++++++++++++++++++++++++++++++++----
 src/synapticsstr.h |    8 ++++++++
 tools/synclient.c  |   46 +++++++++++++++++++++++++++++++++-------------
 tools/syndaemon.c  |   12 +++++++++++-
 8 files changed, 129 insertions(+), 21 deletions(-)

New commits:
commit 881f85578ab4a7c02375bcfc10026ad1a0800cdb
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue May 5 11:02:20 2009 +1000

    If QueryHardware failed, return that failure and clean up.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Christoph Brill <egore911@egore911.de>
    Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
    (cherry picked from commit a9a443959585e7f65ba3f300d387cf617d9df77b)
    
    Conflicts:
    
    	src/synaptics.c

diff --git a/src/synaptics.c b/src/synaptics.c
index 9b89595..710c786 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -729,7 +729,15 @@ DeviceOn(DeviceIntPtr dev)
     xf86FlushInput(local->fd);
 
     /* reinit the pad */
-    QueryHardware(local);
+    if (!QueryHardware(local))
+    {
+        XisbFree(priv->comm.buffer);
+        priv->comm.buffer = NULL;
+        xf86CloseSerial(local->fd);
+        local->fd = -1;
+        return !Success;
+    }
+
     xf86AddEnabledDevice(local);
     dev->public.on = TRUE;
 
@@ -2204,6 +2212,7 @@ QueryHardware(LocalDevicePtr local)
     } else {
 	xf86Msg(X_PROBED, "%s: no supported touchpad found\n", local->name);
 	priv->proto_ops->DeviceOffHook(local);
+	return FALSE;
     }
 
     return TRUE;

commit 2b3325dc53d1a560b94b9c88aeb05b0f7f9085cd
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri May 1 13:37:44 2009 +1000

    Add TouchpadModel specifier and scale the edges accordingly. (#21214)
    
    ALPS models need different edge settings than synaptics pads to make the edges
    work propertly. So try to auto-detect the model (eventcomm anyway) and set the
    edges accordingly.
    
    New edge defaults are:
     synaptics: 7% of the total width
     alps: 15% of the total width
     unknown: 4% of the total width (see Synaptics UI guide)
    
    X.Org Bug 21214 <http://bugs.freedesktop.org/show_bug.cgi?id=21214>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Christoph Brill <egore911@egore911.de>
    Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
    (cherry-picked from commit c50dba0b04f2115a5d23ed4a785c101f9b26900b)

diff --git a/src/eventcomm.c b/src/eventcomm.c
index 3e4c074..3b03695 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -115,6 +115,24 @@ event_query_is_touchpad(int fd)
     return TRUE;
 }
 
+static void
+event_query_info(LocalDevicePtr local)
+{
+    SynapticsPrivate *priv = (SynapticsPrivate *)local->private;
+    short id[4];
+    int rc;
+
+    SYSCALL(rc = ioctl(local->fd, EVIOCGID, id));
+    if (rc < 0)
+        return;
+
+    if (id[ID_VENDOR] == 0x2 && id[ID_PRODUCT] == 0x7)
+        priv->model = MODEL_SYNAPTICS;
+    else if (id[ID_VENDOR] == 0x2 && id[ID_PRODUCT] == 0x8)
+        priv->model = MODEL_ALPS;
+
+}
+
 /* Query device for axis ranges */
 static void
 event_query_axis_ranges(LocalDevicePtr local)
@@ -360,6 +378,7 @@ EventReadDevDimensions(LocalDevicePtr local)
 {
     if (event_query_is_touchpad(local->fd))
 	event_query_axis_ranges(local);
+    event_query_info(local);
 }
 
 static Bool
diff --git a/src/synaptics.c b/src/synaptics.c
index 6b98e6e..9b89595 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -318,7 +318,10 @@ static void set_default_parameters(LocalDevicePtr local)
     /* The synaptics specs specify typical edge widths of 4% on x, and 5.4% on
      * y (page 7) [Synaptics TouchPad Interfacing Guide, 510-000080 - A
      * Second Edition, http://www.synaptics.com/support/dev_support.cfm, 8 Sep
-     * 2008]
+     * 2008]. We use 7% for both instead for synaptics devices, and 15% for
+     * ALPS models.
+     * http://bugs.freedesktop.org/show_bug.cgi?id=21214
+     *
      * If the range was autodetected, apply these edge widths to all four
      * sides.
      */
@@ -330,8 +333,19 @@ static void set_default_parameters(LocalDevicePtr local)
         width = abs(priv->maxx - priv->minx);
         height = abs(priv->maxy - priv->miny);
         diag = sqrt(width * width + height * height);
-        ewidth = width * .04;
-        eheight = height * .055;
+        if (priv->model == MODEL_SYNAPTICS)
+        {
+            ewidth = width * .07;
+            eheight = height * .07;
+        } else if (priv->model == MODEL_ALPS)
+        {
+            ewidth = width * .15;
+            eheight = height * .15;
+        } else
+        {
+            ewidth = width * .04;
+            eheight = height * .04;
+        }
 
         l = priv->minx + ewidth;
         r = priv->maxx - ewidth;
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index 688167c..f518c11 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -79,6 +79,12 @@ enum TapButtonState {
     TBS_BUTTON_DOWN_UP		/* Send button down event + set up state */
 };
 
+enum TouchpadModel {
+    MODEL_UNKNOWN = 0,
+    MODEL_SYNAPTICS,
+    MODEL_ALPS
+};
+
 typedef struct _SynapticsPrivateRec
 {
     SynapticsSHM synpara_default;	/* Default parameter settings, read from
@@ -146,6 +152,8 @@ typedef struct _SynapticsPrivateRec
     Bool has_double;			/* double click detected for this device */
     Bool has_triple;			/* triple click detected for this device */
     Bool has_pressure;			/* device reports pressure */
+
+    enum TouchpadModel model;          /* The detected model */
 } SynapticsPrivate;
 
 #endif /* _SYNAPTICSSTR_H_ */

commit 5456328aea1db9d869fc38d63f1e50f93d1e2dae
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Apr 30 16:03:43 2009 +1000

    Only try to free the timer if it's actually there.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Christoph Brill <egore911@egore911.de>
    Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
    (cherry picked from commit 6dc7f5e127b4b60b27f661862c5698e6f9ea7e49)

diff --git a/src/synaptics.c b/src/synaptics.c
index 2383c38..6b98e6e 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -636,7 +636,9 @@ static void SynapticsUnInit(InputDriverPtr drv,
                             InputInfoPtr   local,
                             int            flags)
 {
-    xfree(((SynapticsPrivate *)local->private)->timer);
+    SynapticsPrivate *priv = ((SynapticsPrivate *)local->private);
+    if (priv && priv->timer)
+        xfree(priv->timer);
     xfree(local->private);
     local->private = NULL;
     xf86DeleteInput(local, 0);

commit bd0eda4e6396825bbc04095c81eb0955d39e2345
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Apr 30 08:15:30 2009 +1000

    man: document left-handed TapButton awkwardness.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Christoph Brill <egore911@egore911.de>
    (cherry picked from commit b00b015aaa81c7da2a419649851004d481f33e3c)

diff --git a/man/synaptics.man b/man/synaptics.man
index b18fb8d..2d4be40 100644
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -813,6 +813,12 @@ by the kernel. If the kernel reports multi-finger detection, two-finger
 vertical scrolling is enabled, horizontal two-finger scrolling is disabled and
 edge scrolling is disabled. If no multi-finger capabilities are reported,
 edge scrolling is enabled for both horizontal and vertical scrolling.
+.LP
+Button mapping for physical buttons is handled in the server.
+If the device is switched to left-handed (an in-server mapping of physical
+buttons 1, 2, 3 to the logical buttons 3, 2, 1, respectively), both physical
+and TapButtons are affected. To counteract this, the TapButtons need to be set
+up in reverse order (TapButton1=3, TapButton2=1).
 
 .SH "REMOVED OPTIONS"
 The following options are no longer part of the driver configuration:

commit 2f4525ce5346e6c370f465b626a045db3f44147f
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri May 1 13:16:47 2009 +1000

    ps2comm: fix typo in debug statement.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit fba24019ffdcf4da8938a3ad61b2f38e40626858)

diff --git a/src/ps2comm.c b/src/ps2comm.c
index 47d656e..e1b66bb 100644
--- a/src/ps2comm.c
+++ b/src/ps2comm.c
@@ -300,7 +300,7 @@ ps2_synaptics_model_id(int fd, struct SynapticsHwInfo *synhw)
 	ps2_getbyte(fd, &mi[1]) &&
 	ps2_getbyte(fd, &mi[2])) {
 	synhw->model_id = (mi[0] << 16) | (mi[1] << 8) | mi[2];
-	PS2DBG(ErrorF("mode-id %06X\n", synhw->model_id));
+	PS2DBG(ErrorF("model-id %06X\n", synhw->model_id));
 	PS2DBG(ErrorF("...done.\n"));
 	return TRUE;
     }

commit 056d41cc3f0c16d13e9428755c619cce76bc1c4f
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Apr 30 15:39:42 2009 +1000

    Fix typo, missing ":"
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    (cherry picked from commit 86df78a2387fbaa2b362446999235ab9c605f8f9)

diff --git a/src/eventcomm.c b/src/eventcomm.c
index c7c5018..3e4c074 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -204,7 +204,7 @@ EventQueryHardware(LocalDevicePtr local, struct SynapticsHwInfo *synhw)
     if (!event_query_is_touchpad(local->fd))
 	return FALSE;
 
-    xf86Msg(X_PROBED, "%s touchpad found\n", local->name);
+    xf86Msg(X_PROBED, "%s: touchpad found\n", local->name);
 
     return TRUE;
 }

commit 386e28b746e7041e5cc1c7ddea7635c3f6a463d1
Author: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
Date:   Tue Apr 28 07:39:36 2009 +1000

    PS/2 interface: sense multifinger taps on FingerHigh (#21427)
    
    Previously multifinger taps were sensed on the Z value > 0: this isn't
    very correct.  Accorging to the specification, Z values below 30
    correspond only to a very light taps or just floating fingers.  I had
    run into the situation when I was clicking on the physical left button
    and that click was transformed to the right button click via
    ClickFinger2, but I wasn't tapping the touchpad at all.  Investigations
    showed very small values of Z -- my other fingers were just floating
    above touchpad.
    
    This change also makes click (and finger) detection more consistent,
    because it uses FingerHigh to detect taps everywhere.
    
    X.Org Bug 21427 <http://bugs.freedesktop.org/show_bug.cgi?id=21427>
    
    Signed-off-by: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Acked-by: Henrik Rydberg <rydberg@euromail.se>
    (cherry picked from commit ef2221322e62b94a88a8358e6513a3f6f232a28f)

diff --git a/src/ps2comm.c b/src/ps2comm.c
index 6c62918..47d656e 100644
--- a/src/ps2comm.c
+++ b/src/ps2comm.c
@@ -40,6 +40,7 @@
 #include "ps2comm.h"
 #include "synproto.h"
 #include "synaptics.h"
+#include "synapticsstr.h"
 #include <xf86.h>
 
 #define MAX_UNSYNC_PACKETS 10				/* i.e. 10 to 60 bytes */
@@ -611,6 +612,8 @@ PS2ReadHwState(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
     int newabs = SYN_MODEL_NEWABS(*synhw);
     unsigned char *buf = comm->protoBuf;
     struct SynapticsHwState *hw = &(comm->hwState);
+    SynapticsPrivate *priv = (SynapticsPrivate *)local->private;
+    SynapticsSHM *para = priv->synpara;
     int w, i;
 
     if (!ps2_synaptics_get_packet(local, synhw, proto_ops, comm))
@@ -709,7 +712,7 @@ PS2ReadHwState(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
 
     hw->y = YMAX_NOMINAL + YMIN_NOMINAL - hw->y;
 
-    if (hw->z > 0) {
+    if (hw->z >= para->finger_high) {
 	int w_ok = 0;
 	/*
 	 * Use capability bits to decide if the w value is valid.

commit 884684db6bf6f9257888cac5d5b3371591581df2
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Apr 24 10:17:29 2009 +1000

    synclient: fix 64 bit issues for float properties.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
    (cherry picked from commit 4f58454f53432f67d221ace60675499d8cee2411)

diff --git a/tools/synclient.c b/tools/synclient.c
index 39b3bf6..2ebd458 100644
--- a/tools/synclient.c
+++ b/tools/synclient.c
@@ -53,6 +53,12 @@
 #endif
 #endif
 
+union flong { /* Xlibs 64-bit property handling madness */
+    long l;
+    float f;
+};
+
+
 enum ParaType {
     PT_INT,
     PT_BOOL,
@@ -531,7 +537,7 @@ dp_set_variables(Display *dpy, XDevice* dev, int argc, char *argv[], int first_c
     unsigned char* data;
     unsigned long nitems, bytes_after;
 
-    float *f;
+    union flong *f;
     long *n;
     char *b;
 
@@ -584,8 +590,8 @@ dp_set_variables(Display *dpy, XDevice* dev, int argc, char *argv[], int first_c
 			    par->name, format);
 		    break;
 		}
-		f = (float*)data;
-		f[par->prop_offset] = val;
+		f = (union flong*)data;
+		f[par->prop_offset].f = val;
 		break;
 	}
 
@@ -606,7 +612,7 @@ dp_show_settings(Display *dpy, XDevice *dev)
     unsigned char* data;
     int len;
 
-    float *f;
+    union flong *f;
     long *i;
     char *b;
 
@@ -660,8 +666,8 @@ dp_show_settings(Display *dpy, XDevice *dev)
 		    break;
 		}
 
-		f = (float*)data;
-		printf("    %-23s = %g\n", par->name, f[par->prop_offset]);
+		f = (union flong*)data;
+		printf("    %-23s = %g\n", par->name, f[par->prop_offset].f);
 		break;
 	}
 

commit 9ce4f0d52f10487a3bf984d247671eef6656c46b
Author: Adam Jackson <ajax@redhat.com>
Date:   Thu Apr 16 11:49:12 2009 +1000

    Allocate the timer early so we don't try to malloc it within a sigio handler.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/synaptics.c b/src/synaptics.c
index ddefecf..2383c38 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -511,9 +511,17 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
     if (!priv)
 	return NULL;
 
+    /* allocate now so we don't allocate in the signal handler */
+    priv->timer = TimerSet(NULL, 0, 0, NULL, NULL);
+    if (!priv->timer) {
+	xfree(priv);
+	return NULL;
+    }
+
     /* Allocate a new InputInfoRec and add it to the head xf86InputDevs. */
     local = xf86AllocateInput(drv, 0);
     if (!local) {
+	xfree(priv->timer);
 	xfree(priv);
 	return NULL;
     }
@@ -614,6 +622,7 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
     if (priv->comm.buffer)
 	XisbFree(priv->comm.buffer);
     free_param_data(priv);
+    xfree(priv->timer);
     xfree(priv);
     local->private = NULL;
     return local;
@@ -627,6 +636,7 @@ static void SynapticsUnInit(InputDriverPtr drv,
                             InputInfoPtr   local,
                             int            flags)
 {
+    xfree(((SynapticsPrivate *)local->private)->timer);
     xfree(local->private);
     local->private = NULL;
     xf86DeleteInput(local, 0);

commit 86edc9c54aa3aadea9eedc9882965800c09de6c3
Author: Peter Hutterer <peter.hutterer@redhat.com>
Date:   Tue Apr 14 07:27:07 2009 -0400

    synclient: fix 32-bit integer handling on 64 bit machines.
    
    libX11 actually expects longs for 32-bit values, even if they are 64 bits.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
    Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
    (cherry picked from commit 74bd8574c796c7ff7c9bea6873b317bf14d29a70)

diff --git a/tools/synclient.c b/tools/synclient.c
index 82ce61b..39b3bf6 100644
--- a/tools/synclient.c
+++ b/tools/synclient.c
@@ -532,7 +532,7 @@ dp_set_variables(Display *dpy, XDevice* dev, int argc, char *argv[], int first_c
     unsigned long nitems, bytes_after;
 
     float *f;
-    int *n;
+    long *n;
     char *b;
 
     float_type = XInternAtom(dpy, XATOM_FLOAT, True);
@@ -573,7 +573,7 @@ dp_set_variables(Display *dpy, XDevice* dev, int argc, char *argv[], int first_c
 			    par->name, format);
 		    break;
 		}
-		n = (int*)data;
+		n = (long*)data;
 		n[par->prop_offset] = rint(val);
 		break;
 	    case 0: /* float */
@@ -607,7 +607,7 @@ dp_show_settings(Display *dpy, XDevice *dev)
     int len;
 
     float *f;
-    int *i;
+    long *i;
     char *b;
 
     float_type = XInternAtom(dpy, XATOM_FLOAT, True);
@@ -648,8 +648,8 @@ dp_show_settings(Display *dpy, XDevice *dev)
 		    break;
 		}
 
-		i = (int*)data;
-		printf("    %-23s = %d\n", par->name, i[par->prop_offset]);
+		i = (long*)data;
+		printf("    %-23s = %ld\n", par->name, i[par->prop_offset]);
 		break;
 	    case 0: /* Float */
 		if (!float_type)

commit 9176090306a945bed06f7debe094c96b8c04a747
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Mar 18 18:38:12 2009 +1000

    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>
    (cherry picked from commit a07a840b26827e1a2c8cccd255177b693c5b91e8)

diff --git a/configure.ac b/configure.ac
index df11400..edbcc05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,6 +85,13 @@ PKG_CHECK_MODULES(XORG, xorg-server xproto $REQUIRED_MODULES)
 sdkdir=$(pkg-config --variable=sdkdir xorg-server)
 AC_SUBST([sdkdir])
 
+PKG_CHECK_MODULES(XORG16, [xorg-server >= 1.6],
+                  HAVE_PROPERTIES="yes"; AC_DEFINE(HAVE_PROPERTIES, 1,
+                                                   "Input Device Property support"),
+                  HAVE_PROPERTIES="no");
+AM_CONDITIONAL(HAVE_PROPERTIES, [ test "$HAVE_PROPERTIES" = "yes" ])
+AC_SUBST(HAVE_PROPERTIES)
+
 CFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src'
 AC_SUBST([CFLAGS])
 
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;
 }
diff --git a/tools/syndaemon.c b/tools/syndaemon.c
index 751c2c9..2a46550 100644
--- a/tools/syndaemon.c
+++ b/tools/syndaemon.c
@@ -63,7 +63,7 @@ static int ignore_modifier_combos;
 static int ignore_modifier_keys;
 static int background;
 static const char *pid_file;
-static int use_shm;
+static int use_shm = 1;
 static Display *display;
 static XDevice *dev;
 static Atom touchpad_off_prop;
@@ -108,6 +108,7 @@ toggle_touchpad(enum TouchpadState value)
     pad_disabled = value;
     if (use_shm)
         synshm->touchpad_off = value;
+#ifdef HAVE_PROPERTIES
     else {
         unsigned char data = value;
         /* This potentially overwrites a different client's setting, but ...*/
@@ -115,6 +116,7 @@ toggle_touchpad(enum TouchpadState value)
 				PropModeReplace, &data, 1);
 	XFlush(display);
     }
+#endif
 }
 
 static void
@@ -453,6 +455,7 @@ void record_main_loop(Display* display, double idle_time) {
 }
 #endif /* HAVE_XRECORD */
 
+#ifdef HAVE_PROPERTIES
 static XDevice *
 dp_get_device(Display *dpy)
 {
@@ -517,6 +520,7 @@ unwind:
     }
     return dev;
 }
+#endif
 
 static int
 shm_init()
@@ -548,6 +552,10 @@ main(int argc, char *argv[])
     int c;
     int use_xrecord = 0;
 
+#ifdef HAVE_PROPERTIES
+    use_shm = 0;
+#endif
+
     /* Parse command line parameters */
     while ((c = getopt(argc, argv, "i:m:dtp:kKR?")) != EOF) {
 	switch(c) {
@@ -596,8 +604,10 @@ main(int argc, char *argv[])
 
     if (use_shm && !shm_init())
 	exit(2);
+#ifdef HAVE_PROPERTIES
     else if (!use_shm && !(dev = dp_get_device(display)))
 	exit(2);
+#endif
 
     /* Install a signal handler to restore synaptics parameters on exit */
     install_signal_handler();


Reply to: