xserver-xorg-input-synaptics: Changes to 'upstream'
.gitignore | 25
COMPATIBILITY | 309 --
COPYING | 37
ChangeLog | 21
FILES | 13
INSTALL | 56
INSTALL.DE | 103
INSTALL.FR | 105
LICENSE | 280 --
Makefile | 180 -
Makefile.am | 22
NEWS | 9
README | 104
README.alps | 77
TODO | 1
Xincludes/README.xincludes | 1
Xincludes/usr/X11R6/include/X11/Xalloca.h | 138 -
Xincludes/usr/X11R6/include/X11/Xdefs.h | 110 -
Xincludes/usr/X11R6/include/X11/Xfuncproto.h | 80
Xincludes/usr/X11R6/include/X11/Xfuncs.h | 92
Xincludes/usr/X11R6/include/X11/extensions/XI.h | 275 --
Xincludes/usr/X11R6/include/X11/extensions/XIproto.h | 1530 --------------
Xincludes/usr/X11R6/lib/Server/include/XIstubs.h | 101
Xincludes/usr/X11R6/lib/Server/include/bstore.h | 23
Xincludes/usr/X11R6/lib/Server/include/bstorestr.h | 75
Xincludes/usr/X11R6/lib/Server/include/colormap.h | 235 --
Xincludes/usr/X11R6/lib/Server/include/cursor.h | 156 -
Xincludes/usr/X11R6/lib/Server/include/dix.h | 1096 ----------
Xincludes/usr/X11R6/lib/Server/include/dixstruct.h | 267 --
Xincludes/usr/X11R6/lib/Server/include/gc.h | 232 --
Xincludes/usr/X11R6/lib/Server/include/globals.h | 52
Xincludes/usr/X11R6/lib/Server/include/input.h | 535 ----
Xincludes/usr/X11R6/lib/Server/include/inputstr.h | 317 --
Xincludes/usr/X11R6/lib/Server/include/mipointer.h | 162 -
Xincludes/usr/X11R6/lib/Server/include/misc.h | 282 --
Xincludes/usr/X11R6/lib/Server/include/miscstruct.h | 73
Xincludes/usr/X11R6/lib/Server/include/opaque.h | 81
Xincludes/usr/X11R6/lib/Server/include/os.h | 856 -------
Xincludes/usr/X11R6/lib/Server/include/pixmap.h | 123 -
Xincludes/usr/X11R6/lib/Server/include/pixmapstr.h | 83
Xincludes/usr/X11R6/lib/Server/include/property.h | 83
Xincludes/usr/X11R6/lib/Server/include/propertyst.h | 76
Xincludes/usr/X11R6/lib/Server/include/region.h | 53
Xincludes/usr/X11R6/lib/Server/include/regionstr.h | 437 ----
Xincludes/usr/X11R6/lib/Server/include/resource.h | 326 ---
Xincludes/usr/X11R6/lib/Server/include/screenint.h | 170 -
Xincludes/usr/X11R6/lib/Server/include/scrnintstr.h | 996 ---------
Xincludes/usr/X11R6/lib/Server/include/validate.h | 42
Xincludes/usr/X11R6/lib/Server/include/window.h | 362 ---
Xincludes/usr/X11R6/lib/Server/include/xf86.h | 389 ---
Xincludes/usr/X11R6/lib/Server/include/xf86Module.h | 197 -
Xincludes/usr/X11R6/lib/Server/include/xf86Opt.h | 82
Xincludes/usr/X11R6/lib/Server/include/xf86Version.h | 31
Xincludes/usr/X11R6/lib/Server/include/xf86Xinput.h | 191 -
Xincludes/usr/X11R6/lib/Server/include/xf86_OSproc.h | 266 --
Xincludes/usr/X11R6/lib/Server/include/xf86_ansic.h | 342 ---
Xincludes/usr/X11R6/lib/Server/include/xf86_libc.h | 658 ------
Xincludes/usr/X11R6/lib/Server/include/xf86str.h | 994 ---------
Xincludes/usr/X11R6/lib/Server/include/xisb.h | 64
Xincludes/usr/X11R6/lib64 | 1
alps.patch | 561 -----
alpscomm.c | 253 --
alpscomm.h | 27
autogen.sh | 12
configure.ac | 125 +
docs/README.alps | 77
docs/trouble-shooting.txt | 152 +
eventcomm.c | 318 --
eventcomm.h | 28
fdi/11-x11-synaptics.fdi | 16
fdi/Makefile.am | 21
freebsd_mouse.h | 55
include/Makefile.am | 21
include/synaptics-properties.h | 142 +
include/synaptics.h | 155 +
linux_input.h | 82
man/Makefile.am | 68
man/synaptics.man | 614 +++++
man/synclient.man | 137 +
man/syndaemon.man | 68
manpages/synaptics.5 | 587 -----
manpages/synclient.1 | 135 -
manpages/syndaemon.1 | 66
pc_keyb.c.diff.2.4.3 | 57
ps2comm.c | 751 -------
ps2comm.h | 82
psmcomm.c | 171 -
psmcomm.h | 8
script/usbhid | 43
script/usbmouse | 18
src/Makefile.am | 48
src/alpscomm.c | 266 ++
src/alpscomm.h | 33
src/eventcomm.c | 365 +++
src/eventcomm.h | 36
src/properties.c | 550 +++++
src/ps2comm.c | 762 +++++++
src/ps2comm.h | 103
src/psmcomm.c | 181 +
src/psmcomm.h | 29
src/synaptics.c | 2037 +++++++++++++++++++
src/synapticsstr.h | 142 +
src/synproto.h | 111 +
synaptics.c | 2018 ------------------
synaptics.h | 253 --
synaptics.spec | 59
synclient.c | 353 ---
syndaemon.c | 320 --
synproto.h | 95
tools/Makefile.am | 31
tools/synclient.c | 367 +++
tools/syndaemon.c | 336 +++
trouble-shooting.txt | 152 -
113 files changed, 7142 insertions(+), 20432 deletions(-)
New commits:
commit a4a8e89a27f24f9c4012c2e28850f108fec7a8fd
Author: Christian Schmitt <chris@ilovelinux.de>
Date: Thu Aug 21 00:33:10 2008 +0200
Add support for Apple touchpads to the fdi file
Apple identifies their touchpads as "appletouch"
diff --git a/fdi/11-x11-synaptics.fdi b/fdi/11-x11-synaptics.fdi
index 6a86341..2f0ace4 100644
--- a/fdi/11-x11-synaptics.fdi
+++ b/fdi/11-x11-synaptics.fdi
@@ -8,6 +8,9 @@
<match key="info.product" contains="AlpsPS/2 ALPS">
<merge key="input.x11_driver" type="string">synaptics</merge>
</match>
+ <match key="info.product" contains="appletouch">
+ <merge key="input.x11_driver" type="string">synaptics</merge>
+ </match>
</match>
</device>
</deviceinfo>
commit 30b57ad9c23c0942375cde4f2b8991b8c60b1824
Author: Christoph Brill <egore911@egore911.de>
Date: Mon Aug 18 18:28:41 2008 +0200
Use config.h if available
diff --git a/src/properties.c b/src/properties.c
index 3fe821f..afee7a4 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -23,6 +23,9 @@
* Authors: Peter Hutterer
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include "xf86Module.h"
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
commit 424a8c96b121e179200d3ecc5aae24cb5445adc2
Author: Peter Hutterer <peter.hutterer@redhat.com>
Date: Mon Aug 18 21:45:17 2008 +0930
Compile fixes.
Yeah, yeah. I know.
diff --git a/src/properties.c b/src/properties.c
index 4376e22..3fe821f 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -194,7 +194,7 @@ InitDeviceProperties(LocalDevicePtr local)
prop_circscroll = InitAtom(local->dev, SYNAPTICS_PROP_CIRCULAR_SCROLLING, 8, 1, ¶->circular_scrolling);
/* FIXME: missing: scroll_dist_circ is a float */
- prop_circscroll_trigger = InitAtom(local->dev, SYNAPTICS_PROP_CIRCULAR_TRIGGER, 8, 1, ¶->circular_trigger);
+ prop_circscroll_trigger = InitAtom(local->dev, SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER, 8, 1, ¶->circular_trigger);
prop_circpad = InitAtom(local->dev, SYNAPTICS_PROP_CIRCULAR_PAD, 8, 1, ¶->circular_pad);
prop_palm = InitAtom(local->dev, SYNAPTICS_PROP_PALM_DETECT, 8, 1, ¶->palm_detect);
diff --git a/src/synaptics.c b/src/synaptics.c
index c628600..1c52e02 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -69,6 +69,7 @@
#include <xf86_OSproc.h>
#include <xf86Xinput.h>
#include "mipointer.h"
+#include <exevents.h>
#include "synaptics.h"
#include "synapticsstr.h"
commit 59f5547d4f00cded7548b27ee780fe4c1526a087
Author: Peter Hutterer <peter.hutterer@redhat.com>
Date: Fri Aug 8 14:57:06 2008 +0930
Add support for device properties.
Exposes the SHMConfig parameters through device properties and allows run-time
changes to those properties.
Not exposed yet are floating point values:
min_speed, max_speed, accl, trackstick_speed (SYNAPTICS_PROP_SPEED)
scroll_dist_circ (SYNAPTICS_PROP_CIRCULAR_SCROLLING_DIST)
coasting_speed (SYNAPTICS_PROP_COASTING_SPEED)
press_motion_min_factor, press_motion_max_factor (SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR)
diff --git a/include/Makefile.am b/include/Makefile.am
index f78a261..2dfab10 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -18,4 +18,4 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-EXTRA_DIST = synaptics.h
+EXTRA_DIST = synaptics.h synaptics-properties.h
diff --git a/include/synaptics-properties.h b/include/synaptics-properties.h
new file mode 100644
index 0000000..ae0bc29
--- /dev/null
+++ b/include/synaptics-properties.h
@@ -0,0 +1,142 @@
+/*
+ * Copyright © 2008 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of Red Hat
+ * not be used in advertising or publicity pertaining to distribution
+ * of the software without specific, written prior permission. Red
+ * Hat makes no representations about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: Peter Hutterer
+ */
+
+#ifndef _SYNAPTICS_PROPERTIES_H_
+#define _SYNAPTICS_PROPERTIES_H_
+
+/**
+ * Properties exported by the synaptics driver. These properties are
+ * recognized by the driver and will change its behavior when modified.
+ * For a description of what each property does, see synaptics.h.
+ */
+
+/* 32 bit, 4 values, left, right, top, bottom */
+#define SYNAPTICS_PROP_EDGES "Synaptics Edges"
+
+/* 32 bit, 3 values, low, high, press */
+#define SYNAPTICS_PROP_FINGER "Synaptics Finger"
+
+/* 32 bit */
+#define SYNAPTICS_PROP_TAP_TIME "Synaptics Tap Time"
+
+/* 32 bit */
+#define SYNAPTICS_PROP_TAP_MOVE "Synaptics Tap Move"
+
+/* 32 bit, 3 values, single touch timeout, max tapping time for double
+ * taps, duration of a single click */
+#define SYNAPTICS_PROP_TAP_DURATIONS "Synaptics Tap Durations"
+
+/* 8 bit (BOOL) */
+#define SYNAPTICS_PROP_TAP_FAST "Synaptics Tap FastTap"
+
+/* 32 bit */
+#define SYNAPTICS_PROP_MIDDLE_TIMEOUT "Synaptics Middle Button Timeout"
+
+/* 32 bit */
+#define SYNAPTICS_PROP_TWOFINGER_PRESSURE "Synaptics Two-Finger Pressure"
+
+/* 32 bit, 2 values, vert, horiz */
+#define SYNAPTICS_PROP_SCROLL_DISTANCE "Synaptics Scrolling Distance"
+
+/* 8 bit (BOOL), 3 values, vertical, horizontal, corner */
+#define SYNAPTICS_PROP_SCROLL_EDGE "Synaptics Edge Scrolling"
+
+/* 8 bit (BOOL), 2 values, vertical, horizontal */
+#define SYNAPTICS_PROP_SCROLL_TWOFINGER "Synaptics Two-Finger Scrolling"
+
+/* XXX 32 bit, 4 values, min, max, accel, trackstick */
+#define SYNAPTICS_PROP_SPEED "Synaptics Move Speed"
+
+/* 32 bit, 2 values, min, max */
+#define SYNAPTICS_PROP_EDGEMOTION_PRESSURE "Synaptics Edge Motion Pressure"
+
+/* 32 bit, 2 values, min, max */
+#define SYNAPTICS_PROP_EDGEMOTION_SPEED "Synaptics Edge Motion Speed"
+
+/* 8 bit (BOOL) */
+#define SYNAPTICS_PROP_EDGEMOTION "Synaptics Edge Motion Always"
+
+/* 8 bit (BOOL), 2 values, updown, leftright */
+#define SYNAPTICS_PROP_BUTTONSCROLLING "Synaptics Button Scrolling"
+
+/* 8 bit (BOOL), 2 values, updown, leftright */
+#define SYNAPTICS_PROP_BUTTONSCROLLING_REPEAT "Synaptics Button Scrolling Repeat"
+
+/* 32 bit */
+#define SYNAPTICS_PROP_BUTTONSCROLLING_TIME "Synaptics Button Scrolling Time"
+
+/* 8 bit, valid values (0, 1, 2) */
+#define SYNAPTICS_PROP_OFF "Synaptics Off"
+
+/* 8 bit (BOOL) */
+#define SYNAPTICS_PROP_GUESTMOUSE "Synaptics Guestmouse Off"
+
+/* 8 bit (BOOL) */
+#define SYNAPTICS_PROP_LOCKED_DRAGS "Synaptics Locked Drags"
+
+/* 32 bit */
+#define SYNAPTICS_PROP_LOCKED_DRAGS_TIMEOUT "Synaptics Locked Drags Timeout"
+
+/* 8 bit, up to MAX_TAP values (see synaptics.h), 0 disables an
+ * element. order: RT, RB, LT, LB, F1, F2, F3 */
+#define SYNAPTICS_PROP_TAP_ACTION "Synaptics Tap Action"
+
+/* 8 bit, up to MAX_CLICK values (see synaptics.h), 0 disables an
+ * element. order: Finger 1, 2, 3 */
+#define SYNAPTICS_PROP_CLICK_ACTION "Synaptics Click Action"
+
+/* 8 bit (BOOL) */
+#define SYNAPTICS_PROP_CIRCULAR_SCROLLING "Synaptics Circular Scrolling"
+
+/* XXX: 32 bit */
+#define SYNAPTICS_PROP_CIRCULAR_SCROLLING_DIST "Synaptics Circular Scrolling Distance"
+
+/* 8 bit, valid values 0..8 (inclusive)
+ * order: any edge, top, top + right, right, right + bottom, bottom, bottom +
+ * left, left, left + top */
+#define SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER "Synaptics Circular Scrolling Trigger"
+
+/* 8 bit (BOOL) */
+#define SYNAPTICS_PROP_CIRCULAR_PAD "Synaptics Circular Pad"
+
+/* 8 bit (BOOL) */
+#define SYNAPTICS_PROP_PALM_DETECT "Synaptics Palm Detection"
+
+/* 32 bit, 2 values, width, z */
+#define SYNAPTICS_PROP_PALM_DIMENSIONS "Synaptics Palm Dimensions"
+
+/* XXX: 32 bit */
+#define SYNAPTICS_PROP_COASTING_SPEED "Synaptics Coasting Speed"
+
+/* 32 bit, 2 values, min, max */
+#define SYNAPTICS_PROP_PRESSURE_MOTION "Synaptics Pressure Motion"
+
+/* XXX: 32 bit, 2 values, min, max */
+#define SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR "Synaptics Pressure Motion Factor"
+
+/* 8 bit (BOOL) */
+#define SYNAPTICS_PROP_GRAB "Synaptics Grab Event Device"
+
+#endif /* _SYNAPTICS_PROPERTIES_H_ */
diff --git a/src/Makefile.am b/src/Makefile.am
index 501d527..fc7d20a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -33,7 +33,8 @@ INCLUDES=-I$(top_srcdir)/include/
@DRIVER_NAME@_drv_la_SOURCES = @DRIVER_NAME@.c synapticsstr.h \
alpscomm.c alpscomm.h \
ps2comm.c ps2comm.h \
- synproto.h
+ synproto.h \
+ properties.c
if BUILD_EVENTCOMM
@DRIVER_NAME@_drv_la_SOURCES += \
diff --git a/src/properties.c b/src/properties.c
new file mode 100644
index 0000000..4376e22
--- /dev/null
+++ b/src/properties.c
@@ -0,0 +1,547 @@
+/*
+ * Copyright © 2008 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of Red Hat
+ * not be used in advertising or publicity pertaining to distribution
+ * of the software without specific, written prior permission. Red
+ * Hat makes no representations about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: Peter Hutterer
+ */
+
+
+#include "xf86Module.h"
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
+
+#include <X11/Xatom.h>
+#include <xf86Xinput.h>
+#include <exevents.h>
+
+#include "synaptics.h"
+#include "synapticsstr.h"
+#include "synaptics-properties.h"
+
+Atom prop_edges = 0;
+Atom prop_finger = 0;
+Atom prop_tap_time = 0;
+Atom prop_tap_move = 0;
+Atom prop_tap_durations = 0;
+Atom prop_tap_fast = 0;
+Atom prop_middle_timeout = 0;
+Atom prop_twofinger_pressure = 0;
+Atom prop_scrolldist = 0;
+Atom prop_scrolledge = 0;
+Atom prop_scrolltwofinger = 0;
+Atom prop_speed = 0;
+Atom prop_edgemotion_pressure = 0;
+Atom prop_edgemotion_speed = 0;
+Atom prop_edgemotion_always = 0;
+Atom prop_buttonscroll = 0;
+Atom prop_buttonscroll_repeat = 0;
+Atom prop_buttonscroll_time = 0;
+Atom prop_off = 0;
+Atom prop_guestmouse = 0;
+Atom prop_lockdrags = 0;
+Atom prop_lockdrags_time = 0;
+Atom prop_tapaction = 0;
+Atom prop_clickaction = 0;
+Atom prop_circscroll = 0;
+Atom prop_circscroll_dist = 0;
+Atom prop_circscroll_trigger = 0;
+Atom prop_circpad = 0;
+Atom prop_palm = 0;
+Atom prop_palm_dim = 0;
+Atom prop_coastspeed = 0;
+Atom prop_pressuremotion = 0;
+Atom prop_grab = 0;
+
+static Atom
+InitAtom(DeviceIntPtr dev, char *name, int format, int nvalues, int *values)
+{
+ int i;
+ Atom atom;
+ uint8_t val_8[9]; /* we never have more than 9 values in an atom */
+ uint16_t val_16[9];
+ uint32_t val_32[9];
+ pointer converted;
+
+
+ for (i = 0; i < nvalues; i++)
+ {
+ switch(format)
+ {
+ case 8: val_8[i] = values[i]; break;
+ case 16: val_16[i] = values[i]; break;
+ case 32: val_32[i] = values[i]; break;
+ }
+ }
+
+ switch(format)
+ {
+ case 8: converted = val_8; break;
+ case 16: converted = val_16; break;
+ case 32: converted = val_32; break;
+ }
+
+ atom = MakeAtom(name, strlen(name), TRUE);
+ XIChangeDeviceProperty(dev, atom, XA_INTEGER, format,
+ PropModeReplace, nvalues,
+ converted, FALSE, FALSE, FALSE);
+ return atom;
+}
+
+/**
+ * Configure the property if the atom is valid.
+ */
+static void
+ConfigureProperty(DeviceIntPtr dev, Atom atom, int nvalues, long* values)
+{
+ if (atom)
+ XIConfigureDeviceProperty(dev, atom, FALSE, FALSE, FALSE, nvalues, values);
+}
+
+void
+InitDeviceProperties(LocalDevicePtr local)
+{
+ SynapticsPrivate *priv = (SynapticsPrivate *) local->private;
+ SynapticsSHM *para = priv->synpara;
+
+ int i;
+ int values[9]; /* we never have more than 9 values in an atom */
+ long valid_values[9];
+
+ values[0] = para->left_edge;
+ values[1] = para->right_edge;
+ values[2] = para->top_edge;
+ values[3] = para->bottom_edge;
+
+ prop_edges = InitAtom(local->dev, SYNAPTICS_PROP_EDGES, 32, 4, values);
+
+ values[0] = para->finger_low;
+ values[1] = para->finger_high;
+ values[2] = para->finger_press;
+
+ prop_finger = InitAtom(local->dev, SYNAPTICS_PROP_FINGER, 32, 3, values);
+ prop_tap_time = InitAtom(local->dev, SYNAPTICS_PROP_TAP_TIME, 32, 1, ¶->tap_time);
+ prop_tap_move = InitAtom(local->dev, SYNAPTICS_PROP_TAP_MOVE, 32, 1, ¶->tap_move);
+
+ values[0] = para->single_tap_timeout;
+ values[1] = para->tap_time_2;
+ values[2] = para->click_time;
+
+ prop_tap_durations = InitAtom(local->dev, SYNAPTICS_PROP_TAP_DURATIONS, 32, 3, values);
+ prop_tap_fast = InitAtom(local->dev, SYNAPTICS_PROP_TAP_FAST, 8, 1, ¶->fast_taps);
+ prop_middle_timeout = InitAtom(local->dev, SYNAPTICS_PROP_MIDDLE_TIMEOUT,
+ 32, 1, ¶->emulate_mid_button_time);
+ prop_twofinger_pressure = InitAtom(local->dev, SYNAPTICS_PROP_TWOFINGER_PRESSURE,
+ 32, 1, ¶->emulate_twofinger_z);
+
+ values[0] = para->scroll_dist_vert;
+ values[1] = para->scroll_dist_horiz;
+ prop_scrolldist = InitAtom(local->dev, SYNAPTICS_PROP_SCROLL_DISTANCE, 32, 2, values);
+
+ values[0] = para->scroll_edge_vert;
+ values[1] = para->scroll_edge_horiz;
+ values[2] = para->scroll_edge_corner;
+ prop_scrolledge = InitAtom(local->dev, SYNAPTICS_PROP_SCROLL_EDGE,8, 3, values);
+ values[0] = para->scroll_twofinger_vert;
+ values[1] = para->scroll_twofinger_horiz;
+ prop_scrolltwofinger = InitAtom(local->dev, SYNAPTICS_PROP_SCROLL_TWOFINGER,8, 2, values);
+
+ /* FIXME: MISSING: speed is a float */
+
+ values[0] = para->edge_motion_min_z;
+ values[1] = para->edge_motion_max_z;
+ prop_edgemotion_pressure = InitAtom(local->dev, SYNAPTICS_PROP_EDGEMOTION_PRESSURE, 32, 2, values);
+
+ values[0] = para->edge_motion_min_speed;
+ values[1] = para->edge_motion_max_speed;
+ prop_edgemotion_speed = InitAtom(local->dev, SYNAPTICS_PROP_EDGEMOTION_SPEED, 32, 2, values);
+ prop_edgemotion_always = InitAtom(local->dev, SYNAPTICS_PROP_EDGEMOTION, 8, 1, ¶->edge_motion_use_always);
+
+ values[0] = para->updown_button_scrolling;
+ values[1] = para->leftright_button_scrolling;
+ prop_buttonscroll = InitAtom(local->dev, SYNAPTICS_PROP_BUTTONSCROLLING, 8, 2, values);
+
+ values[0] = para->updown_button_repeat;
+ values[1] = para->leftright_button_repeat;
+ prop_buttonscroll_repeat = InitAtom(local->dev, SYNAPTICS_PROP_BUTTONSCROLLING_REPEAT, 8, 2, values);
+ prop_buttonscroll_time = InitAtom(local->dev, SYNAPTICS_PROP_BUTTONSCROLLING_TIME, 32, 1, ¶->scroll_button_repeat);
+ prop_off = InitAtom(local->dev, SYNAPTICS_PROP_OFF, 8, 1, ¶->touchpad_off);
+ prop_guestmouse = InitAtom(local->dev, SYNAPTICS_PROP_GUESTMOUSE, 8, 1, ¶->guestmouse_off);
+ prop_lockdrags = InitAtom(local->dev, SYNAPTICS_PROP_LOCKED_DRAGS, 8, 1, ¶->locked_drags);
+ prop_lockdrags_time = InitAtom(local->dev, SYNAPTICS_PROP_LOCKED_DRAGS_TIMEOUT, 32, 1, ¶->locked_drag_time);
+
+ memcpy(values, para->tap_action, MAX_TAP * sizeof(int));
+ prop_tapaction = InitAtom(local->dev, SYNAPTICS_PROP_TAP_ACTION, 8, MAX_TAP, values);
+
+ memcpy(values, para->click_action, MAX_CLICK * sizeof(int));
+ prop_clickaction = InitAtom(local->dev, SYNAPTICS_PROP_CLICK_ACTION, 8, MAX_CLICK, values);
+
+ prop_circscroll = InitAtom(local->dev, SYNAPTICS_PROP_CIRCULAR_SCROLLING, 8, 1, ¶->circular_scrolling);
+ /* FIXME: missing: scroll_dist_circ is a float */
+ prop_circscroll_trigger = InitAtom(local->dev, SYNAPTICS_PROP_CIRCULAR_TRIGGER, 8, 1, ¶->circular_trigger);
+ prop_circpad = InitAtom(local->dev, SYNAPTICS_PROP_CIRCULAR_PAD, 8, 1, ¶->circular_pad);
+ prop_palm = InitAtom(local->dev, SYNAPTICS_PROP_PALM_DETECT, 8, 1, ¶->palm_detect);
+
+ values[0] = para->palm_min_width;
+ values[1] = para->palm_min_z;
+
+ prop_palm_dim = InitAtom(local->dev, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 2, values);
+
+ /* FIXME: missing, coastspeed is a float */
+
+ values[0] = para->press_motion_min_z;
+ values[1] = para->press_motion_max_z;
+ prop_pressuremotion = InitAtom(local->dev, SYNAPTICS_PROP_PRESSURE_MOTION, 32, 2, values);
+
+ /* FIXME: missing, motion_min/max is a float */
+
+ prop_grab = InitAtom(local->dev, SYNAPTICS_PROP_GRAB, 8, 1, ¶->grab_event_device);
+
+ /* Configure value ranges as appropriate */
+
+ /* boolean properties */
+ valid_values[0] = TRUE;
+ valid_values[0] = FALSE;
+ ConfigureProperty(local->dev, prop_tap_fast, 2, valid_values);
+ ConfigureProperty(local->dev, prop_scrolledge, 2, valid_values);
+ ConfigureProperty(local->dev, prop_scrolltwofinger, 2, valid_values);
+ ConfigureProperty(local->dev, prop_edgemotion_always, 2, valid_values);
+ ConfigureProperty(local->dev, prop_buttonscroll, 2, valid_values);
+ ConfigureProperty(local->dev, prop_buttonscroll_repeat, 2, valid_values);
+ ConfigureProperty(local->dev, prop_guestmouse, 2, valid_values);
+ ConfigureProperty(local->dev, prop_lockdrags, 2, valid_values);
+ ConfigureProperty(local->dev, prop_circscroll, 2, valid_values);
+ ConfigureProperty(local->dev, prop_circpad, 2, valid_values);
+ ConfigureProperty(local->dev, prop_palm, 2, valid_values);
+ ConfigureProperty(local->dev, prop_grab, 2, valid_values);
+ /* end of boolean props */
+
+ valid_values[0] = 0;
+ valid_values[1] = 1;
+ valid_values[2] = 2;
+ ConfigureProperty(local->dev, prop_off, 3, valid_values);
+
+ for (i = 0; i <= 8; i++)
+ valid_values[i] = i;
+ ConfigureProperty(local->dev, prop_circscroll_trigger, 8, valid_values);
+}
+
+Bool
+SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop)
+{
+ LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate;
+ SynapticsPrivate *priv = (SynapticsPrivate *) local->private;
+ SynapticsSHM *para = priv->synpara;
+
+ if (property == prop_edges)
+ {
+ INT32 *edges;
+ if (prop->size != 4 || prop->format != 32 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ edges = (INT32*)prop->data;
+ if (edges[0] > edges[1] || edges[2] > edges[3])
+ return FALSE;
+
+ para->left_edge = edges[0];
+ para->right_edge = edges[1];
+ para->top_edge = edges[2];
+ para->bottom_edge = edges[3];
+
+ } else if (property == prop_finger)
+ {
+ INT32 *finger;
+ if (prop->size != 3 || prop->format != 32 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ finger = (INT32*)prop->data;
+ if (finger[0] > finger[1])
+ return FALSE;
+
+ para->finger_low = finger[0];
+ para->finger_high = finger[1];
+ para->finger_press = finger[2];
+
+ } else if (property == prop_tap_time)
+ {
+ if (prop->size != 1 || prop->format != 32 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ para->tap_time = *(INT32*)prop->data;
+
+ } else if (property == prop_tap_move)
+ {
+ if (prop->size != 1 || prop->format != 32 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ para->tap_move = *(INT32*)prop->data;
+ } else if (property == prop_tap_durations)
+ {
+ INT32 *timeouts;
+
+ if (prop->size != 3 || prop->format != 32 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ timeouts = (INT32*)prop->data;
+
+ para->single_tap_timeout = timeouts[0];
+ para->tap_time_2 = timeouts[1];
+ para->click_time = timeouts[2];
+
+ } else if (property == prop_tap_fast)
+ {
+ if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ para->fast_taps = *(BOOL*)prop->data;
+
+ } else if (property == prop_middle_timeout)
+ {
+ if (prop->size != 1 || prop->format != 32 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ para->emulate_mid_button_time = *(INT32*)prop->data;
+ } else if (property == prop_twofinger_pressure)
+ {
+ if (prop->size != 1 || prop->format != 32 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ para->emulate_twofinger_z = *(INT32*)prop->data;
+ } else if (property == prop_scrolldist)
+ {
+ INT32 *dist;
+ if (prop->size != 2 || prop->format != 32 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ dist = (INT32*)prop->data;
+ para->scroll_dist_vert = dist[0];
+ para->scroll_dist_horiz = dist[1];
+ } else if (property == prop_scrolledge)
+ {
+ CARD8 *edge;
+ if (prop->size != 3 || prop->format != 8 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ edge = (BOOL*)prop->data;
+ para->scroll_edge_vert = edge[0];
+ para->scroll_edge_horiz = edge[1];
+ para->scroll_edge_corner = edge[2];
+ } else if (property == prop_scrolltwofinger)
+ {
+ CARD8 *twofinger;
+
+ if (prop->size != 2 || prop->format != 8 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ twofinger = (BOOL*)prop->data;
+ para->scroll_twofinger_vert = twofinger[0];
+ para->scroll_twofinger_horiz = twofinger[1];
+ } else if (property == prop_speed)
+ {
+ /* XXX */
+ } else if (property == prop_edgemotion_pressure)
+ {
+ CARD32 *pressure;
+
+ if (prop->size != 2 || prop->format != 32 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ pressure = (CARD32*)prop->data;
+ if (pressure[0] > pressure[1])
+ return FALSE;
+
+ para->edge_motion_min_z = pressure[0];
+ para->edge_motion_max_z = pressure[1];
+
+ } else if (property == prop_edgemotion_speed)
+ {
+ CARD32 *speed;
+
+ if (prop->size != 2 || prop->format != 32 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ speed = (CARD32*)prop->data;
+ if (speed[0] > speed[1])
+ return FALSE;
+
+ para->edge_motion_min_speed = speed[0];
+ para->edge_motion_max_speed = speed[1];
+
+ } else if (property == prop_edgemotion_always)
+ {
+ if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ para->edge_motion_use_always = *(BOOL*)prop->data;
+
+ } else if (property == prop_buttonscroll)
+ {
+ BOOL *scroll;
+
+ if (prop->size != 2 || prop->format != 8 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ scroll = (BOOL*)prop->data;
+ para->updown_button_scrolling = scroll[0];
+ para->leftright_button_scrolling = scroll[1];
+
+ } else if (property == prop_buttonscroll_repeat)
+ {
+ BOOL *repeat;
+
+ if (prop->size != 2 || prop->format != 8 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ repeat = (BOOL*)prop->data;
+ para->updown_button_repeat = repeat[0];
+ para->leftright_button_repeat = repeat[1];
+ } else if (property == prop_buttonscroll_time)
+ {
+ if (prop->size != 1 || prop->format != 32 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ para->scroll_button_repeat = *(INT32*)prop->data;
+
+ } else if (property == prop_off)
+ {
+ CARD8 off;
+ if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ off = *(CARD8*)prop->data;
+
+ if (off > 2)
+ return FALSE;
+
+ para->touchpad_off = off;
+ } else if (property == prop_guestmouse)
+ {
+ if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ para->guestmouse_off = *(BOOL*)prop->data;
+ } else if (property == prop_lockdrags)
+ {
+ if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ para->locked_drags = *(BOOL*)prop->data;
+ } else if (property == prop_lockdrags_time)
+ {
+ if (prop->size != 1 || prop->format != 32 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ para->locked_drag_time = *(INT32*)prop->data;
+ } else if (property == prop_tapaction)
+ {
+ int i;
+ CARD8 *action;
+
+ if (prop->size >= MAX_TAP || prop->format != 8 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ action = (CARD8*)prop->data;
+
+ for (i = 0; i < MAX_TAP; i++)
+ para->tap_action[i] = action[i];
+ } else if (property == prop_clickaction)
+ {
+ int i;
+ CARD8 *action;
+
+ if (prop->size >= MAX_CLICK || prop->format != 8 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ action = (CARD8*)prop->data;
+
+ for (i = 0; i < MAX_CLICK; i++)
+ para->click_action[i] = action[i];
+ } else if (property == prop_circscroll)
+ {
+ if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ para->circular_scrolling = *(BOOL*)prop->data;
+
+ } else if (property == prop_circscroll_dist)
+ {
+ /* FIXME */
+ } else if (property == prop_circscroll_trigger)
+ {
+ int trigger;
+ if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ trigger = *(CARD8*)prop->data;
+ if (trigger > 8)
+ return FALSE;
+
+ para->circular_trigger = trigger;
+
+ } else if (property == prop_circpad)
+ {
+ if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ para->circular_pad = *(BOOL*)prop->data;
+ } else if (property == prop_palm)
+ {
+ if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ para->palm_detect = *(BOOL*)prop->data;
+ } else if (property == prop_palm_dim)
+ {
+ INT32 *dim;
+
+ if (prop->size != 2 || prop->format != 32 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ dim = (INT32*)prop->data;
+
+ para->palm_min_width = dim[0];
+ para->palm_min_z = dim[1];
+ } else if (property == prop_coastspeed)
+ {
+ /* FIXME */
+ } else if (property == prop_pressuremotion)
+ {
+ INT32 *press;
+ if (prop->size != 2 || prop->format != 32 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ press = (INT32*)prop->data;
+ if (press[0] > press[1])
+ return FALSE;
+
+ para->press_motion_min_z = press[0];
+ para->press_motion_max_z = press[1];
+ } else if (property == prop_grab)
+ {
+ if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
+ return FALSE;
+
+ para->grab_event_device = *(BOOL*)prop->data;
+ }
+
+ return TRUE;
+}
+
+#endif
+
diff --git a/src/synaptics.c b/src/synaptics.c
index 9fc661a..c628600 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -72,6 +72,7 @@
#include "synaptics.h"
#include "synapticsstr.h"
+#include "synaptics-properties.h"
typedef enum {
BOTTOM_EDGE = 1,
@@ -120,6 +121,8 @@ static Bool DeviceOff(DeviceIntPtr);
static Bool DeviceClose(DeviceIntPtr);
static Bool QueryHardware(LocalDevicePtr);
+void InitDeviceProperties(LocalDevicePtr local);
+Bool SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop);
InputDriverRec SYNAPTICS = {
1,
@@ -491,6 +494,7 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
xf86CloseSerial(local->fd);
}
local->fd = -1;
+
return local;
SetupProc_fail:
@@ -660,6 +664,11 @@ DeviceInit(DeviceIntPtr dev)
if (!alloc_param_data(local))
return !Success;
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
+ InitDeviceProperties(local);
+ XIRegisterPropertyHandler(local->dev, SetProperty, NULL);
+#endif
+
return Success;
}
@@ -2024,3 +2033,4 @@ QueryHardware(LocalDevicePtr local)
priv->proto_ops->DeviceOffHook(local);
return TRUE;
}
+
commit 58166896c43b1eb225fef9b3c3b799619a5950bf
Author: Mattia Dongili <malattia@debian.org>
Date: Sat Jun 7 09:01:38 2008 +0200
Add 02-scandir-dev-input.patch from Debian
Scan all the event devices in /dev/input
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 95ff57a..e3ac20e 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -33,6 +33,8 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <dirent.h>
+#include <string.h>
#include <stdio.h>
Reply to: