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

2016-11-18 Thread Andreas Boll
Rebased ref, commits from common ancestor:
commit 3261e07c923c449f08a96a8439c97479b7ff899c
Author: Peter Hutterer 
Date:   Fri Nov 18 13:00:09 2016 +1000

synaptics 1.9.0

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index 970dd5f..6d814d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.8.99.2],
+[1.9.0],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit a7d76f4275a88d98b18eed29a1ee94a70e7fa367
Author: Peter Hutterer 
Date:   Sun Oct 9 19:27:47 2016 +1000

synaptics 1.8.99.2

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index b3d0545..970dd5f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.8.99.1],
+[1.8.99.2],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 35b9472a189c88415fed137fb4c62a5081caaea5
Author: Peter Hutterer 
Date:   Thu Sep 15 13:47:09 2016 +1000

Remove unused fraction calculations

hw.x and the motion history are integers so our deltas are always integers.
It's a bit pointless to split them into the fractional and integral part.

obsolete since defc1d008e5674306a or so

Signed-off-by: Peter Hutterer 

diff --git a/src/synaptics.c b/src/synaptics.c
index bdc9605..c7ba9ad 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2198,28 +2198,8 @@ static void
 get_delta(SynapticsPrivate *priv, const struct SynapticsHwState *hw,
   enum EdgeType edge, double *dx, double *dy)
 {
-double integral;
-double tmpf;
-
 *dx = hw->x - HIST(0).x;
 *dy = hw->y - HIST(0).y;
-
-/* report edge speed as synthetic motion. Of course, it would be
- * cooler to report floats than to buffer, but anyway. */
-
-/* FIXME: When these values go NaN, bad things happen. Root cause is 
unknown
- * thus far though. */
-if (isnan(priv->frac_x))
-priv->frac_x = 0;
-if (isnan(priv->frac_y))
-priv->frac_y = 0;
-
-tmpf = *dx + priv->frac_x;
-priv->frac_x = modf(tmpf, &integral);
-*dx = integral;
-tmpf = *dy + priv->frac_y;
-priv->frac_y = modf(tmpf, &integral);
-*dy = integral;
 }
 
 /* Vector length, but not sqrt'ed, we only need it for comparison */
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index 905b78b..33524e5 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -288,7 +288,6 @@ struct _SynapticsPrivateRec {
 Bool circ_scroll_on;/* Keeps track of currently active scroll 
modes */
 Bool circ_scroll_vert;  /* True: Generate vertical scroll events
False: Generate horizontal events */
-double frac_x, frac_y;  /* absolute -> relative fraction */
 enum MidButtonEmulation mid_emu_state;  /* emulated 3rd button */
 int repeatButtons;  /* buttons for repeat */
 int nextRepeat; /* Time when to trigger next auto repeat event 
*/

commit 486322116d70365c2e2a1d9f45830057fa03153e
Author: Peter Hutterer 
Date:   Wed Aug 17 11:32:12 2016 +1000

eventcomm: don't ever probe if a device is set

If opening the fd fails we still need to fail the device. This is 
particularly
the case when a device disappears before we can open it - the current code
wouldn't exit but instead switch to auto-probe touchpad devices on the 
system.

Signed-off-by: Peter Hutterer 
Reviewed-by: Hans de Goede 

diff --git a/src/eventcomm.c b/src/eventcomm.c
index 9c9a036..f65d532 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -1009,13 +1009,13 @@ EventAutoDevProbe(InputInfoPtr pInfo, const char 
*device)
 
 if (!(pInfo->flags & XI86_SERVER_FD))
 SYSCALL(close(fd));
-
-/* if a device is set and not a touchpad (or already grabbed),
- * we must return FALSE.  Otherwise, we'll add a device that
- * wasn't requested for and repeat
- * f5687a6741a19ef3081e7fd83ac55f6df8bcd5c2. */
-return touchpad_found;
 }
+
+/* if a device is set and not a touchpad (or already grabbed),
+ * we must return FALSE.  Otherwise, we'll add a device that
+ * wasn't requested for and repeat
+ * f5687a6741a19ef3081e7fd83ac55f6df8bcd5c2. */
+return touchpad_found;
 }
 
 i = scandir(DEV_INPUT_EVENT, &namelist, EventDevOnly, alphasort);

commit cd9f9799235aefff1ec1a0af9ec6b45969119659
Author: Anton Lindqvist 
Date:   Fri Aug 5 10:21:59 2016 +0200

syndaemon: enable touchpad when pressing a modifier combo

When ignoring modifiers, ensure the touchpad is enabled once a modifier
key is pressed disrega

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

2016-01-24 Thread Julien Cristau
 configure.ac|2 +-
 src/eventcomm.c |8 +---
 src/synaptics.c |8 +---
 3 files changed, 11 insertions(+), 7 deletions(-)

New commits:
commit af7d8a15278a968d919bf539628281bf713f747b
Author: Peter Hutterer 
Date:   Thu Oct 29 12:10:09 2015 +1000

synaptics 1.8.3

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index b90e5b2..0b706a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.8.2],
+[1.8.3],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 3e7508ac087028f8f8e116f5279dad1ebcdc58e6
Author: Gabriele Mazzotta 
Date:   Thu Aug 14 20:03:42 2014 +0200

Use cumulative relative touch movements while scrolling

Signed-off-by: Gabriele Mazzotta 
Reviewed-by: Peter Hutterer 
Signed-off-by: Peter Hutterer 
(cherry picked from commit ec0901e5f81d9cad6cc8bbdcb5ea075009c13de5)

diff --git a/src/eventcomm.c b/src/eventcomm.c
index 589a6de..635ec2c 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -697,9 +697,11 @@ EventReadHwState(InputInfoPtr pInfo,
 
 SynapticsResetTouchHwState(hw, FALSE);
 
-/* Reset cumulative values if buttons were not previously pressed,
- * or no finger was previously present. */
-if ((!hw->left && !hw->right && !hw->middle) || hw->z < para->finger_low) {
+/* Reset cumulative values if buttons were not previously pressed and no
+ * two-finger scrolling is ongoing, or no finger was previously present. */
+if (((!hw->left && !hw->right && !hw->middle) &&
+!(priv->vert_scroll_twofinger_on || priv->vert_scroll_twofinger_on)) ||
+hw->z < para->finger_low) {
 hw->cumulative_dx = hw->x;
 hw->cumulative_dy = hw->y;
 sync_cumulative = TRUE;
diff --git a/src/synaptics.c b/src/synaptics.c
index 2d49a12..6f8889b 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -3111,9 +3111,11 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState 
*hw, CARD32 now,
 }
 }
 
-/* If a physical button is pressed on a clickpad, use cumulative relative
- * touch movements for motion */
-if (para->clickpad && (priv->lastButtons & 7) &&
+/* If a physical button is pressed on a clickpad or a two-finger scrolling
+ * is ongoing, use cumulative relative touch movements for motion */
+if (para->clickpad &&
+((priv->lastButtons & 7) ||
+(priv->vert_scroll_twofinger_on || priv->horiz_scroll_twofinger_on)) &&
 priv->last_button_area != TOP_BUTTON_AREA) {
 hw->x = hw->cumulative_dx;
 hw->y = hw->cumulative_dy;



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

2014-09-17 Thread Maximilian Attems
 src/eventcomm.c|   51 +++---
 src/eventcomm.h|2 +
 src/properties.c   |1 
 src/ps2comm.c  |3 ++
 src/ps2comm.h  |2 +
 src/synaptics.c|   64 -
 src/synapticsstr.h |2 +
 src/synproto.h |2 +
 8 files changed, 114 insertions(+), 13 deletions(-)

New commits:
commit a897147be04d74ed452cda166fd4e01f9615ff72
Author: Gabriele Mazzotta 
Date:   Tue Sep 16 17:20:15 2014 +0200

Use ABS_MT events for the palm detection when supported

Use ABS_MT_TOUCH_MAJOR and ABS_MT_PRESSURE instead of ABS_TOOL_WIDTH
and ABS_PRESSURE when supported so that the pressure and the width of
all the fingers is taken into account for the palm detection.

This also fixes the palm detection for those touchpads for which the
kernel only sends ABS_MT_TOUCH_MAJOR and not ABS_TOOL_WIDTH.

Signed-off-by: Gabriele Mazzotta 
Signed-off-by: Peter Hutterer 

diff --git a/src/eventcomm.c b/src/eventcomm.c
index e789f0e..4850331 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -606,6 +606,14 @@ EventProcessTouchEvent(InputInfoPtr pInfo, struct 
SynapticsHwState *hw,
 hw->slot_state[slot_index] = SLOTSTATE_CLOSE;
 proto_data->num_touches--;
 }
+
+/* When there are no fingers on the touchpad, set width and
+ * pressure to zero as ABS_MT_TOUCH_MAJOR and ABS_MT_PRESSURE
+ * are not zero when fingers are released. */
+if (proto_data->num_touches == 0) {
+hw->fingerWidth = 0;
+hw->z = 0;
+}
 }
 else {
 ValuatorMask *mask = proto_data->last_mt_vals[slot_index];
@@ -618,6 +626,10 @@ EventProcessTouchEvent(InputInfoPtr pInfo, struct 
SynapticsHwState *hw,
 hw->cumulative_dx += ev->value - last_val;
 else if (ev->code == ABS_MT_POSITION_Y)
 hw->cumulative_dy += ev->value - last_val;
+else if (ev->code == ABS_MT_TOUCH_MAJOR)
+hw->fingerWidth = ev->value;
+else if (ev->code == ABS_MT_PRESSURE)
+hw->z = ev->value;
 }
 
 valuator_mask_set(mask, map, ev->value);
diff --git a/src/synaptics.c b/src/synaptics.c
index 756751d..9807439 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1829,6 +1829,9 @@ SynapticsDetectFinger(SynapticsPrivate * priv, struct 
SynapticsHwState *hw)
 if ((hw->z > para->palm_min_z) && (hw->fingerWidth > para->palm_min_width))
 return FS_BLOCKED;
 
+if (priv->has_touch)
+return finger;
+
 if (hw->x == 0 || priv->finger_state == FS_UNTOUCHED)
 priv->avg_width = 0;
 else

commit 41b2312c006fca1f24e1a366174d3203a63fa04a
Author: Peter Hutterer 
Date:   Tue Sep 16 08:52:56 2014 +1000

Limit the movement to 20 mm per event

Touchpads are limited by a fixed sampling rate (usually 80Hz). Some finger
changes may happen too fast for this sampling rate, resulting in two 
distinct
event sequences:
* finger 1 up and finger 2 down in the same EV_SYN frame. Synaptics sees one
  finger down before and after and the changed coordinates
* finger 1 up and finger 2 down _between_ two EV_SYN frames. Synaptics sees 
one
  touchpoint move from f1 position to f2 position.

That move causes a large cursor jump. The former could be solved (with
difficulty) by adding fake EV_SYN handling after releasing touchpoints but
that won't fix the latter case.

So as a solution for now limit the finger movement to 20mm per event.
Tests on a T440 and an x220 showed that this is just above what a reasonable
finger movement would trigger. If a movement is greater than that limit, 
reset
it to 0/0.

On devices without resolution, use 0.25 of the touchpad's diagonal instead.

Signed-off-by: Peter Hutterer 
Reviewed-by: Hans de Goede 

diff --git a/src/synaptics.c b/src/synaptics.c
index 2e3ad0c..756751d 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -780,6 +780,23 @@ set_default_parameters(InputInfoPtr pInfo)
 pars->resolution_vert = 1;
 }
 
+/* Touchpad sampling rate is too low to detect all movements.
+   A user may lift one finger and put another one down within the same
+   EV_SYN or even between samplings so the driver doesn't notice at all.
+
+   We limit the movement to 20 mm within one event, that is more than
+   recordings showed is needed (17mm on a T440).
+  */
+if (pars->resolution_horiz > 1 &&
+pars->resolution_vert > 1)
+pars->maxDeltaMM = 20;
+else {
+/* on devices without resolution set the vector length to 0.25 of
+   the touchpad diagonal */
+pars->maxDeltaMM = diag * 0.25;
+}
+
+
 /* Warn about (and fix) incorrectly configured TopEdge/BottomEd

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

2014-08-14 Thread Maximilian Attems
 conf/50-synaptics.conf |2 +-
 configure.ac   |9 -
 src/eventcomm.c|   48 +---
 src/synaptics.c|5 +++--
 4 files changed, 41 insertions(+), 23 deletions(-)

New commits:
commit 7d0ff39519e4d3760722b914883bee276035061c
Author: Gabriele Mazzotta 
Date:   Sun Jul 27 12:58:18 2014 +0200

Prevent two-finger taps from being ignored

When two fingers are used, the coordinates of only one of them is taken into
account. This can lead to sudden variations of the absolute coordinates when
two-fingers taps are performed if the finger considered changes.

Take into account coordinates variations to prevent unwanted taps only if
the number of fingers doesn't change.

Reviewed-by: Peter Hutterer 
Signed-off-by: Peter Hutterer 

diff --git a/src/synaptics.c b/src/synaptics.c
index b25c902..b49957c 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1960,8 +1960,9 @@ HandleTapProcessing(SynapticsPrivate * priv, struct 
SynapticsHwState *hw,
 (priv->tap_max_fingers <=
  ((priv->horiz_scroll_twofinger_on ||
priv->vert_scroll_twofinger_on) ? 2 : 1)) &&
-((abs(hw->x - priv->touch_on.x) >= para->tap_move) ||
- (abs(hw->y - priv->touch_on.y) >= para->tap_move)));
+(priv->prevFingers == hw->numFingers &&
+ ((abs(hw->x - priv->touch_on.x) >= para->tap_move) ||
+  (abs(hw->y - priv->touch_on.y) >= para->tap_move;
 press = (hw->left || hw->right || hw->middle);
 
 if (touch) {

commit a36edf8307ab9b5bffca103dd875623a66012c0b
Author: Peter Hutterer 
Date:   Thu May 15 08:34:55 2014 +1000

Use libevdev's per-device logging functions instead of the global handler

Per-device logging functions don't interfere with other drivers if they also
use libevdev, so use those instead the global log handler if available. If 
not
available, drop libevdev logging, I don't want to maintain the ifdef mess 
and
the logging doesn't give us _that_ much benefit.

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index 4b3a726..0a2bfb6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -117,6 +117,13 @@ esac
 if test "x$BUILD_EVENTCOMM" = xyes; then
 AC_DEFINE(BUILD_EVENTCOMM, 1, [Optional backend eventcomm enabled])
 PKG_CHECK_MODULES(LIBEVDEV, [libevdev >= 0.4])
+SAVE_LIBS="$LIBS"
+LIBS="$LIBEVDEV_LIBS"
+AC_CHECK_LIB(evdev, libevdev_set_device_log_function,
+  [AC_DEFINE(HAVE_LIBEVDEV_DEVICE_LOG_FUNCS, 1,
+   [libevdev supports per-device log functions])],
+   [])
+LIBS="$SAVE_LIBS"
 fi
 if test "x$BUILD_PSMCOMM" = xyes; then
 AC_DEFINE(BUILD_PSMCOMM, 1, [Optional backend psmcomm enabled])
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 2ee072b..1f440b8 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -90,15 +90,18 @@ struct eventcomm_proto_data {
 enum libevdev_read_flag read_flag;
 };
 
+#ifdef HAVE_LIBEVDEV_DEVICE_LOG_FUNCS
 static void
-libevdev_log_func(enum libevdev_log_priority priority,
+libevdev_log_func(const struct libevdev *dev,
+  enum libevdev_log_priority priority,
   void *data,
   const char *file, int line, const char *func,
   const char *format, va_list args)
-_X_ATTRIBUTE_PRINTF(6, 0);
+_X_ATTRIBUTE_PRINTF(7, 0);
 
 static void
-libevdev_log_func(enum libevdev_log_priority priority,
+libevdev_log_func(const struct libevdev *dev,
+  enum libevdev_log_priority priority,
   void *data,
   const char *file, int line, const char *func,
   const char *format, va_list args)
@@ -113,14 +116,7 @@ libevdev_log_func(enum libevdev_log_priority priority,
 
 LogVMessageVerbSigSafe(X_NOTICE, verbosity, format, args);
 }
-
-static void
-set_libevdev_log_handler(void)
-{
-  /* be quiet, gcc *handwave* */
-libevdev_set_log_function((libevdev_log_func_t)libevdev_log_func, NULL);
-libevdev_set_log_priority(LIBEVDEV_LOG_DEBUG);
-}
+#endif
 
 struct eventcomm_proto_data *
 EventProtoDataAlloc(int fd)
@@ -128,7 +124,6 @@ EventProtoDataAlloc(int fd)
 struct eventcomm_proto_data *proto_data;
 int rc;
 
-set_libevdev_log_handler();
 
 proto_data = calloc(1, sizeof(struct eventcomm_proto_data));
 if (!proto_data)
@@ -137,12 +132,31 @@ EventProtoDataAlloc(int fd)
 proto_data->st_to_mt_scale[0] = 1;
 proto_data->st_to_mt_scale[1] = 1;
 
-rc = libevdev_new_from_fd(fd, &proto_data->evdev);
+proto_data->evdev = libevdev_new();
+if (!proto_data->evdev) {
+rc = -1;
+goto out;
+}
+
+#ifdef HAVE_LIBEVDEV_DEVICE_LOG_FUNCS
+libevdev_set_device_log_function(proto_data->evdev, libevdev_log_func,
+ LIBEVDEV_LOG_DEBUG

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

2014-07-12 Thread Maximilian Attems
Rebased ref, commits from common ancestor:
commit ddd8844a47bfa28974e40fc9aec9b17656415a6c
Author: Peter Hutterer 
Date:   Mon May 19 08:06:46 2014 +1000

eventcomm: Drop requirement for a grab during init

When we required a grab on the device, this was a shortcut so we didn't have
to query the device only to realise we can't read events off it anyway. Now
that we don't actually grab the device by default, this is unnecessary.

Something else may have a temporary grab on the device during init, in which
case we just continue as usual and read events if and when they become
available.

Signed-off-by: Peter Hutterer 
Reviewed-by: Hans de Goede 

diff --git a/src/eventcomm.c b/src/eventcomm.c
index 37de38a..2ee072b 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -278,49 +278,33 @@ EventDeviceOffHook(InputInfoPtr pInfo)
  * - BTN_TOOL_PEN is _not_ set
  *
  * @param evdev Libevdev handle
- * @param test_grab If true, test whether an EVIOCGRAB is possible on the
- * device. A failure to grab the event device returns in a failure.
  *
  * @return TRUE if the device is a touchpad or FALSE otherwise.
  */
 static Bool
-event_query_is_touchpad(struct libevdev *evdev, BOOL test_grab)
+event_query_is_touchpad(struct libevdev *evdev)
 {
-int ret = FALSE, rc;
-
-if (test_grab) {
-rc = libevdev_grab(evdev, LIBEVDEV_GRAB);
-if (rc < 0)
-return FALSE;
-}
-
 /* Check for ABS_X, ABS_Y, ABS_PRESSURE and BTN_TOOL_FINGER */
 if (!libevdev_has_event_type(evdev, EV_SYN) ||
 !libevdev_has_event_type(evdev, EV_ABS) ||
 !libevdev_has_event_type(evdev, EV_KEY))
-goto unwind;
+return FALSE;
 
 if (!libevdev_has_event_code(evdev, EV_ABS, ABS_X) ||
 !libevdev_has_event_code(evdev, EV_ABS, ABS_Y))
-goto unwind;
+return FALSE;
 
 /* we expect touchpad either report raw pressure or touches */
 if (!libevdev_has_event_code(evdev, EV_KEY, BTN_TOUCH) &&
 !libevdev_has_event_code(evdev, EV_ABS, ABS_PRESSURE))
-goto unwind;
+return FALSE;
 
 /* all Synaptics-like touchpad report BTN_TOOL_FINGER */
 if (!libevdev_has_event_code(evdev, EV_KEY, BTN_TOOL_FINGER) ||
 libevdev_has_event_code(evdev, EV_ABS, BTN_TOOL_PEN)) /* Don't match 
wacom tablets */
-goto unwind;
-
-ret = TRUE;
-
- unwind:
-if (test_grab)
-libevdev_grab(evdev, LIBEVDEV_UNGRAB);
+return FALSE;
 
-return (ret == TRUE);
+return TRUE;
 }
 
 #define PRODUCT_ANY 0x
@@ -512,8 +496,7 @@ EventQueryHardware(InputInfoPtr pInfo)
 SynapticsPrivate *priv = (SynapticsPrivate *) pInfo->private;
 struct eventcomm_proto_data *proto_data = priv->proto_data;
 
-if (!event_query_is_touchpad(proto_data->evdev,
- (proto_data) ? proto_data->need_grab : TRUE))
+if (!event_query_is_touchpad(proto_data->evdev))
 return FALSE;
 
 xf86IDrvMsg(pInfo, X_PROBED, "touchpad found\n");
@@ -912,7 +895,7 @@ EventReadDevDimensions(InputInfoPtr pInfo)
 proto_data->axis_map[i] = -1;
 proto_data->cur_slot = -1;
 
-if (event_query_is_touchpad(proto_data->evdev, proto_data->need_grab)) {
+if (event_query_is_touchpad(proto_data->evdev)) {
 event_query_touch(pInfo);
 event_query_axis_ranges(pInfo);
 }
@@ -946,7 +929,7 @@ EventAutoDevProbe(InputInfoPtr pInfo, const char *device)
 
 rc = libevdev_new_from_fd(fd, &evdev);
 if (rc >= 0) {
-touchpad_found = event_query_is_touchpad(evdev, TRUE);
+touchpad_found = event_query_is_touchpad(evdev);
 libevdev_free(evdev);
 }
 
@@ -988,7 +971,7 @@ EventAutoDevProbe(InputInfoPtr pInfo, const char *device)
 
 rc = libevdev_new_from_fd(fd, &evdev);
 if (rc >= 0) {
-touchpad_found = event_query_is_touchpad(evdev, TRUE);
+touchpad_found = event_query_is_touchpad(evdev);
 libevdev_free(evdev);
 if (touchpad_found) {
 xf86IDrvMsg(pInfo, X_PROBED, "auto-dev sets device to 
%s\n",

commit 3a4cc96590ca0e0ff526a5e5406f29a402bddd1a
Author: Peter Hutterer 
Date:   Tue May 13 11:20:25 2014 +1000

synaptics 1.8.0

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index 712d48d..91b3eda 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.7.99.2],
+[1.8.0],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit d4d7229c41a20cf6757882a24f45e28d936a27c5
Author: Peter Hutterer 
Date:   Wed Apr 30 13:08:53 2014 +1000

conf: drop the PNPID matching from the fdi file

Rely on INPUT_PROP_TOP_BUTTONPAD and default button areas as well.
 

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

2014-03-12 Thread Michele Cane
 configure.ac   |2 
 include/synaptics-properties.h |3 
 man/synaptics.man  |   60 ++---
 src/properties.c   |   65 ++
 src/synaptics.c|  181 -
 src/synapticsstr.h |   15 +++
 tools/synclient.c  |8 +
 7 files changed, 317 insertions(+), 17 deletions(-)

New commits:
commit 8a5533aaa7e6e57bca7674de4cd25b3a18217d44
Author: Peter Hutterer 
Date:   Wed Mar 12 09:42:38 2014 +1000

synaptics 1.7.4

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index ea5c002..c41e6da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.7.3],
+[1.7.4],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit c189854a688465c820d5ef5767e00b69394a1601
Author: Keith Packard 
Date:   Sat Feb 22 01:44:37 2014 -0800

Close device if DeviceOnHook fails

Signed-off-by: Keith Packard 
Signed-off-by: Peter Hutterer 
(cherry picked from commit 22fe8bdc6668e78853768c62f4d1331114c7eca0)

diff --git a/src/synaptics.c b/src/synaptics.c
index 1c22873..0986e20 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -959,8 +959,10 @@ DeviceOn(DeviceIntPtr dev)
 }
 
 if (priv->proto_ops->DeviceOnHook &&
-!priv->proto_ops->DeviceOnHook(pInfo, &priv->synpara))
+!priv->proto_ops->DeviceOnHook(pInfo, &priv->synpara)) {
+xf86CloseSerial(pInfo->fd);
 return !Success;
+}
 
 priv->comm.buffer = XisbNew(pInfo->fd, INPUT_BUFFER_SIZE);
 if (!priv->comm.buffer) {

commit 503082bf17dfc4cb3d4b794ea514ac6f413c07f2
Author: Peter Hutterer 
Date:   Tue Feb 18 10:14:37 2014 +1000

man: setting scroll deltas to 0 doesn't work (#75074)

6d47d33 disallows a zero value for horizontal/vertical scroll deltas but the
man page wasn't updated. We've added separate toggles to enable/disable
scrolling a few years ago, setting the distance to 0 is not recommended.

X.Org Bug 75074 

Signed-off-by: Peter Hutterer 
(cherry picked from commit 2ea76fad6545a712713de1a09965158805e83c55)

diff --git a/man/synaptics.man b/man/synaptics.man
index eb04eb2..7da7527 100644
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -585,9 +585,6 @@ effect on scrolling speed.
 Scrolling speed is determined solely from the VertScrollDelta and
 HorizScrollDelta parameters.
 .
-To disable vertical or horizontal scrolling, set VertScrollDelta or
-HorizScrollDelta to zero.
-.
 To invert the direction of vertical or horizontal scrolling, set
 VertScrollDelta or HorizScrollDelta to a negative value.
 .

commit 0b70c76eab57822526585bbd11a1408bd115f26b
Author: Peter Hutterer 
Date:   Thu Feb 13 14:55:12 2014 +1000

Revert "Drop circular pad support"

This reverts commit 3b02e7fd81da4b100fb9ac32378f6d50f54cf0e2.

Signed-off-by: Peter Hutterer 

Conflicts:
man/synaptics.man
src/synaptics.c

Acked-by: Daniel Stone 
(cherry picked from commit 4f543ce1d6ae9ca11086a3009d149505590584a8)

diff --git a/include/synaptics-properties.h b/include/synaptics-properties.h
index b717880..19bd2b2 100644
--- a/include/synaptics-properties.h
+++ b/include/synaptics-properties.h
@@ -116,6 +116,9 @@
 #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 */
diff --git a/man/synaptics.man b/man/synaptics.man
index 7652404..eb04eb2 100644
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -351,6 +351,13 @@ l l.
 .TE
 Property: "Synaptics Circular Scrolling Trigger"
 .TP
+.BI "Option \*qCircularPad\*q \*q" boolean \*q
+.
+Instead of being a rectangle, the edge is the ellipse enclosed by the
+Left/Right/Top/BottomEdge parameters.
+.
+For circular touchpads. Property: "Synaptics Circular Pad"
+.TP
 .BI "Option \*qPalmDetect\*q \*q" boolean \*q
 If palm detection should be enabled.
 .
@@ -933,7 +940,6 @@ The following options are no longer part of the driver 
configuration:
 .TP
 .BI "Option \*qEdgeMotionUseAlways\*q \*q" boolean \*q
 .TP
-.BI "Option \*qCircularPad\*q \*q" boolean \*q
 
 .SH "AUTHORS"
 .LP
diff --git a/src/properties.c b/src/properties.c
index 0041544..886d8c2 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -295,6 +295,9 @@ InitDeviceProperties(InputInfoPtr pInfo)
 prop_circscroll_trigger =
 InitAtom(pInfo->dev, SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER, 8, 1,
  ΒΆ->circular_trigger);
+prop_circpad =
+InitAtom(pInfo->dev, SYNAPTICS_PROP_CIRCULAR_PAD, 8, 1,

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

2014-01-13 Thread Michele Cane
 configure.ac   |2 +-
 src/synapticsstr.h |6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 90d93891be0dcc55d87c349ab438144ead818402
Author: Peter Hutterer 
Date:   Mon Jan 13 15:14:06 2014 +1000

synaptics 1.7.3

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index a9b8b2b..ea5c002 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.7.2],
+[1.7.3],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit b227ca373de79fe6852ac09e71465c048790cd5b
Author: Peter Hutterer 
Date:   Fri Jan 3 11:23:22 2014 +1000

Fix ABI detection for in-driver scaling

Signed-off-by: Peter Hutterer 
(cherry picked from commit 49fe70e99d1b0932ab915824c78f952a0fdb3ee7)

diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index a9901a2..3d6f756 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -28,13 +28,13 @@
 #define LogMessageVerbSigSafe xf86MsgVerb
 #endif
 
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 19
-#if GET_ABI_MINOR(ABI_XINPUT_VERSION) >= 2
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) > 19
+#define NO_DRIVER_SCALING 1
+#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 19 && 
GET_ABI_MINOR(ABI_XINPUT_VERSION) >= 2
 /* as of 19.2, the server takes device resolution into account when scaling
relative events from abs device, so we must not scale in synaptics. */
 #define NO_DRIVER_SCALING 1
 #endif
-#endif
 
 #ifdef DBG
 #undef DBG


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/e1w2dy0-0006hs...@moszumanska.debian.org



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

2013-12-10 Thread Michele Cane
 configure.ac   |2 +-
 src/eventcomm.c|1 +
 src/properties.c   |   13 +
 src/synaptics.c|9 +
 src/synapticsstr.h |   10 ++
 5 files changed, 34 insertions(+), 1 deletion(-)

New commits:
commit 88d926d12a1f5c06ee2825de5bc4bec29c78
Author: Peter Hutterer 
Date:   Mon Dec 9 11:28:23 2013 +1000

synaptics 1.7.2

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index 5dfbc4e..a9b8b2b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.7.1],
+[1.7.2],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 61243ada3e1e10f6d32a899a6cc595efa244eb25
Author: Peter Hutterer 
Date:   Wed Dec 4 07:58:26 2013 +1000

eventcomm: ungrab the device on DeviceOff

For symmetry, the kernel should ungrab when we close the fd.

Signed-off-by: Peter Hutterer 

[modified for the 1.7 branch which isn't using libevdev yet]

(cherry picked from commit 5d391e352f4e502ada6444a7ce860683e3480fbf)

diff --git a/src/eventcomm.c b/src/eventcomm.c
index 258a538..a9a344b 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -206,6 +206,7 @@ static Bool
 EventDeviceOffHook(InputInfoPtr pInfo)
 {
 UninitializeTouch(pInfo);
+SYSCALL(ioctl(pInfo->fd, EVIOCGRAB, (pointer) 0));
 
 return Success;
 }

commit 09ac39309fbee01aa047dab1b0f577dc2571cdd1
Author: Peter Hutterer 
Date:   Thu Dec 5 09:31:11 2013 +1000

Add missing property handler for the pressure motion factor

Signed-off-by: Peter Hutterer 
(cherry picked from commit 29318c1d94510cfb6d5d712e912af111f99edb42)

diff --git a/src/properties.c b/src/properties.c
index dd88fc7..797f1da 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -650,6 +650,19 @@ SetProperty(DeviceIntPtr dev, Atom property, 
XIPropertyValuePtr prop,
 para->press_motion_min_z = press[0];
 para->press_motion_max_z = press[1];
 }
+else if (property == prop_pressuremotion_factor) {
+float *press;
+
+if (prop->size != 2 || prop->format != 32 || prop->type != float_type)
+return BadMatch;
+
+press = (float *) prop->data;
+if (press[0] > press[1])
+return BadValue;
+
+para->press_motion_min_factor = press[0];
+para->press_motion_max_factor = press[1];
+}
 else if (property == prop_grab) {
 if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
 return BadMatch;

commit f4ddbde165843924195b08551d7d6d6200c44b23
Author: Peter Hutterer 
Date:   Fri Jul 19 11:08:43 2013 +1000

Disable driver scaling for input ABI 19.2

For absolute devices in relative mode, i.e. touchpads, the server now takes
device resolution into account. Doing so means that the driver mustn't
scale, so we deactivate those bits in the driver.

Signed-off-by: Peter Hutterer 
(cherry picked from commit 0fb59b3487d57523a03f078a2061e2ea0cacbc7c)

diff --git a/src/synaptics.c b/src/synaptics.c
index eb38271..e391a98 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -133,9 +133,11 @@ static int DeviceOff(DeviceIntPtr);
 static int DeviceClose(DeviceIntPtr);
 static Bool QueryHardware(InputInfoPtr);
 static void ReadDevDimensions(InputInfoPtr);
+#ifndef NO_DRIVER_SCALING
 static void ScaleCoordinates(SynapticsPrivate * priv,
  struct SynapticsHwState *hw);
 static void CalculateScalingCoeffs(SynapticsPrivate * priv);
+#endif
 static void SanitizeDimensions(InputInfoPtr pInfo);
 
 void InitDeviceProperties(InputInfoPtr pInfo);
@@ -829,7 +831,10 @@ SynapticsPreInit(InputDriverPtr drv, InputInfoPtr pInfo, 
int flags)
 
 set_default_parameters(pInfo);
 
+#ifndef NO_DRIVER_SCALING
 CalculateScalingCoeffs(priv);
+#endif
+
 
 priv->comm.buffer = XisbNew(pInfo->fd, INPUT_BUFFER_SIZE);
 
@@ -2863,7 +2868,9 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState 
*hw, CARD32 now,
  * calculations that require unadjusted coordinates, for example edge
  * detection.
  */
+#ifndef NO_DRIVER_SCALING
 ScaleCoordinates(priv, hw);
+#endif
 }
 
 dx = dy = 0;
@@ -2987,6 +2994,7 @@ QueryHardware(InputInfoPtr pInfo)
 return TRUE;
 }
 
+#ifndef NO_DRIVER_SCALING
 static void
 ScaleCoordinates(SynapticsPrivate * priv, struct SynapticsHwState *hw)
 {
@@ -3016,3 +3024,4 @@ CalculateScalingCoeffs(SynapticsPrivate * priv)
 priv->vert_coeff = 1;
 }
 }
+#endif
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index 428befa..a9901a2 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -28,6 +28,14 @@
 #define LogMessageVerbSigSafe xf86MsgVerb
 #endif
 
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 19
+#if GET_ABI_MINOR(ABI_XINPUT_VERSION) >= 2
+/* as of 19.2, the server takes de

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

2013-09-05 Thread Julien Cristau
Rebased ref, commits from common ancestor:
commit 96cf04dce19e7c90bc05b8b3b192b5bfb97381d2
Author: Peter Hutterer 
Date:   Mon May 13 10:03:48 2013 +1000

synaptics 1.7.1

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index b8a75cd..5dfbc4e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.7.0],
+[1.7.1],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 3bd40423b26ab692174ddcdd12489467ba876926
Author: Peter Hutterer 
Date:   Thu May 9 11:09:51 2013 +1000

Plug memory leak for priv->touch_axes

Allocated in event_query_touch, was never freed.

Signed-off-by: Peter Hutterer 
Reviewed-by: Dave Airlie 

diff --git a/src/synaptics.c b/src/synaptics.c
index d4b21a9..eb38271 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1035,6 +1035,8 @@ DeviceClose(DeviceIntPtr dev)
 RetValue = DeviceOff(dev);
 TimerFree(priv->timer);
 priv->timer = NULL;
+free(priv->touch_axes);
+priv->touch_axes = NULL;
 SynapticsHwStateFree(&priv->hwState);
 SynapticsHwStateFree(&priv->old_hw_state);
 SynapticsHwStateFree(&priv->local_hw_state);

commit eb50f8023e9ce11c3f0249ef9ddf398a1d983c84
Author: Peter Hutterer 
Date:   Thu May 9 11:06:12 2013 +1000

Plug memory leak for option_string

xf86SetStrOption() returns a strdup'd string that must be freed after use.

Signed-off-by: Peter Hutterer 
Reviewed-by: Dave Airlie 

diff --git a/src/synaptics.c b/src/synaptics.c
index 2de05d4..d4b21a9 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -513,12 +513,15 @@ set_softbutton_areas_option(InputInfoPtr pInfo)
 memcpy(pars->softbutton_areas[0], values, 4 * sizeof(int));
 memcpy(pars->softbutton_areas[1], values + 4, 4 * sizeof(int));
 
+free(option_string);
+
 return;
 
  fail:
 xf86IDrvMsg(pInfo, X_ERROR,
 "invalid SoftButtonAreas value '%s', keeping defaults\n",
 option_string);
+free(option_string);
 }
 
 static void

commit 7cc0ebf0858ebb505d933839f25bb269a8cdb764
Author: Peter Hutterer 
Date:   Fri Apr 26 10:09:10 2013 +1000

Fix stack smash in clickpad_guess_clickfingers()

Apple Magic Trackpad can report 16 slots. In clickpad_guess_clickfingers()
the array allocated on the stack contains only 10 slots.
As (.num_mt_mask == .num_slots), the function writes out of the bounds
of close_point.

Use a size 32 bitmask instead and warn if we ever get past 32 touchpoints.

This fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=952221

Signed-off-by: Peter Hutterer 
Reported-by: Benjamin Tissoires 

diff --git a/src/synaptics.c b/src/synaptics.c
index f0a8269..2de05d4 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2453,10 +2453,11 @@ clickpad_guess_clickfingers(SynapticsPrivate * priv,
 struct SynapticsHwState *hw)
 {
 int nfingers = 0;
-char close_point[SYNAPTICS_MAX_TOUCHES] = { 0 };/* 1 for each point 
close
-   to another one */
+uint32_t close_point = 0; /* 1 bit for each point close to another one */
 int i, j;
 
+BUG_RETURN_VAL(hw->num_mt_mask > sizeof(close_point) * 8, 0);
+
 for (i = 0; i < hw->num_mt_mask - 1; i++) {
 ValuatorMask *f1;
 
@@ -2488,14 +2489,16 @@ clickpad_guess_clickfingers(SynapticsPrivate * priv,
  * size. Good luck. */
 if (abs(x1 - x2) < (priv->maxx - priv->minx) * .3 &&
 abs(y1 - y2) < (priv->maxy - priv->miny) * .3) {
-close_point[j] = 1;
-close_point[i] = 1;
+close_point |= (1 << j);
+close_point |= (1 << i);
 }
 }
 }
 
-for (i = 0; i < SYNAPTICS_MAX_TOUCHES; i++)
-nfingers += close_point[i];
+while (close_point > 0) {
+nfingers += close_point & 0x1;
+close_point >>= 1;
+}
 
 return nfingers;
 }

commit ac47b4ea5b4f7b920b84a1e70adce3475e3be346
Author: Peter Hutterer 
Date:   Wed Apr 3 10:50:50 2013 +1000

Allow soft button areas to overlap on the edge

For percent-based configuration in the form of
middle button 33%-66%, right button 66%-0 we'd get an error because of the
one device unit overlap. This was neither documented nor useful, because
leaving a 1% gap leaves an actual gap between the buttons. Allow for an
overlap of one device unit on the edge of the buttons.

What's picked in that case depends on the implementation of
is_inside_softbutton_area but since one device unit is so small, it doesn't
matter.

Signed-off-by: Peter Hutterer 

diff --git a/man/synaptics.man b/man/synaptics.man
index 2b7b7b9..079a5f8 100644
--- a/man/synaptics

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

2012-10-01 Thread Julien Cristau
 src/synaptics.c |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit eae444eb1a85d2401501d29f9a6c654c046f806b
Author: Peter Hutterer 
Date:   Thu Aug 30 16:38:38 2012 +1000

Reset num_active_touches on DeviceOff (#52496)

When disabling the device, reset num_active_touches to zero. Otherwise,
num_active_touches stays at the value it was on DeviceOff(). Future touches
add to that value until the index may go past priv->open_slots[].
That causes spurious memory corruption on touch ends.

And as of 55fc42e7c9b4948cadd4f98ef7b6a3b12e268e3e we ignore pre-existing
touches anyway.

Test-case:
- place num_touches fingers on the touchpad
- xinput disable 
- lift fingers
- xinput enable 
- place finger on device, num_active_touches is now (num_touches + 1)

X.Org Bug 52496 

Signed-off-by: Peter Hutterer 
Reviewed-by: Chase Douglas 
(cherry picked from commit a245d42f53096b1ae81e6702729f97ca508e5b5b)

Conflicts:
src/synaptics.c

diff --git a/src/synaptics.c b/src/synaptics.c
index cd9f936..a28e984 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1154,6 +1154,7 @@ SynapticsReset(SynapticsPrivate * priv)
 priv->prev_z = 0;
 priv->prevFingers = 0;
 #ifdef HAVE_MULTITOUCH
+priv->num_active_touches = 0;
 memset(priv->open_slots, 0, priv->num_slots * sizeof(int));
 #endif
 }
@@ -3118,6 +3119,7 @@ UpdateTouchState(InputInfoPtr pInfo, struct 
SynapticsHwState *hw)
 if (hw->slot_state[i] == SLOTSTATE_OPEN) {
 priv->open_slots[priv->num_active_touches] = i;
 priv->num_active_touches++;
+BUG_WARN(priv->num_active_touches > priv->num_slots);
 }
 else if (hw->slot_state[i] == SLOTSTATE_CLOSE) {
 Bool found = FALSE;


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/e1timtb-0002r3...@vasks.debian.org



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

2012-06-13 Thread Cyril Brulebois
 configure.ac |2 +-
 src/eventcomm.c  |5 ++---
 src/properties.c |6 ++
 src/synaptics.c  |   24 +---
 src/synproto.c   |4 ++--
 5 files changed, 32 insertions(+), 9 deletions(-)

New commits:
commit d5ff9d8b0b186cf39695df84a10984eac559b746
Author: Peter Hutterer 
Date:   Tue Jun 12 13:46:34 2012 +1000

synaptics 1.6.2

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index 3e7ec2a..894d4f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.6.1.901],
+[1.6.2],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit c1aae820601a911432c64938f03eab62bafaab2f
Author: Peter Hutterer 
Date:   Fri May 18 09:38:50 2012 +1000

synaptics 1.6.1.901

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index 565daf2..3e7ec2a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.6.1],
+[1.6.1.901],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 7ccca8e7d8fbf2ccb5a2dbbfbf06ff4dbd6b7149
Author: Peter Hutterer 
Date:   Thu May 17 12:10:04 2012 +1000

Don't allow for scroll distances of 0 (#49965)

It'll either hang the server or blow up with divisions by 0, whichever one
comes first.

X.Org Bug 49965 

Signed-off-by: Peter Hutterer 
Reviewed-by: Chase Douglas 
(cherry picked from commit 6d47d334d8a876e7e094306c313246b87016b78a)

diff --git a/src/properties.c b/src/properties.c
index 44ac306..3b3f1c5 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -519,6 +519,9 @@ SetProperty(DeviceIntPtr dev, Atom property, 
XIPropertyValuePtr prop,
 return BadMatch;
 
 dist = (INT32 *) prop->data;
+if (dist[0] == 0 || dist[1] == 0)
+return BadValue;
+
 if (para->scroll_dist_vert != dist[0]) {
 para->scroll_dist_vert = dist[0];
 #ifdef HAVE_SMOOTH_SCROLL
@@ -715,6 +718,9 @@ SetProperty(DeviceIntPtr dev, Atom property, 
XIPropertyValuePtr prop,
 return BadMatch;
 
 circdist = *(float *) prop->data;
+if (circdist == 0)
+return BadValue;
+
 para->scroll_dist_circ = circdist;
 }
 else if (property == prop_circscroll_trigger) {

commit f8d970e191e6df05a8f2c26afdeea3e27b941a62
Author: Peter Hutterer 
Date:   Thu May 17 11:02:02 2012 +1000

Reset hw->x/y to INT_MIN and skip HandleState until we have x/y events

The driver assumes x/y is always valid but after coming from a resume we may
get a few events with either ABS_X or ABS_Y (not both). Thus we process with
hw->x == 0 and hw->y == somevalue, causing cursor jumps when calculating
deltas whenver the real hw->x comes in.

Fix this by resetting hw->x/y to INT_MIN and skip state processing until
both axes are available.

For clickpads, this means handling of data will be delayed until we get
at least one motion on each axis. Button presses won't be recognised either
until that happens. It requires some skill to not trigger motion on both
axes, even more to press a button without doing so.

For non-clickpads, handling of motion events will be delayed likewise. If a
physical button is pressed immediately after resume we have to assume deltas
of x/y.
- If the next event is a new touch, it will have ABS_X/ABS_Y set anyway
- If the finger was already down, a button event is generated, and the
  finger has generated ABS_X or ABS_Y only before the event, the next event
  containing the missing data will cause a jump. The fix for this is more
  invasive and this is quite a corner-case.

Signed-off-by: Peter Hutterer 
Reviewed-by: Chase Douglas 
(cherry picked from commit cd569377cda9b5a4ee00c0137db14f625c76c40f)

diff --git a/src/synaptics.c b/src/synaptics.c
index 78660f4..cd9f936 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -3278,6 +3278,19 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState 
*hw, CARD32 now,
 return delay;
 }
 
+/* We need both and x/y, the driver can't handle just one of the two
+ * yet. But since it's possible to hit a phys button on non-clickpads
+ * without ever getting motion data first, we must continue with 0/0 for
+ * that case. */
+if (hw->x == INT_MIN || hw->y == INT_MAX) {
+if (para->clickpad)
+return delay;
+else if (hw->left || hw->right || hw->middle) {
+hw->x = (hw->x == INT_MIN) ? 0 : hw->x;
+hw->y = (hw->y == INT_MIN) ? 0 : hw->y;
+}
+}
+
 /* 

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

2012-05-20 Thread Cyril Brulebois
 configure.ac   |2 
 include/synaptics-properties.h |2 
 include/synaptics.h|   39 
 src/alpscomm.c |   97 -
 src/eventcomm.c|  663 +-
 src/eventcomm.h|8 
 src/properties.c   |  583 +
 src/ps2comm.c  |  534 
 src/ps2comm.h  |   21 
 src/psmcomm.c  |   71 -
 src/synaptics.c| 2569 +
 src/synapticsstr.h |  361 ++---
 src/synproto.c |   42 
 src/synproto.h |   54 
 test/eventcomm-test.c  |   86 -
 test/fake-symbols.c|  176 +-
 test/fake-symbols.h|  169 +-
 tools/synclient.c  |  588 -
 tools/syndaemon.c  |  604 -
 19 files changed, 3413 insertions(+), 3256 deletions(-)

New commits:
commit e0f5688994baa85a8c658120681575cdd0ba2a58
Author: Peter Hutterer 
Date:   Fri May 11 10:30:21 2012 +1000

synaptics 1.6.1

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index e5b92f9..565daf2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.6.0],
+[1.6.1],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 7f2d9d88204c62de3cb63b48001b9e2408d3a20d
Author: Peter Hutterer 
Date:   Fri May 11 10:54:47 2012 +1000

tools: coasting speed is not capped at 20, cap it at 255

Signed-off-by: Peter Hutterer 
(cherry picked from commit 0352c67fa2a7224b5a3bf03a934b3c7af42b4f51)

diff --git a/tools/synclient.c b/tools/synclient.c
index 7ec6923..f08a275 100644
--- a/tools/synclient.c
+++ b/tools/synclient.c
@@ -130,7 +130,7 @@ static struct Parameter params[] = {
 {"PalmDetect",PT_BOOL,   0, 1, SYNAPTICS_PROP_PALM_DETECT, 
8,  0},
 {"PalmMinWidth",  PT_INT,0, 15,
SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 0},
 {"PalmMinZ",  PT_INT,0, 255,   
SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 1},
-{"CoastingSpeed", PT_DOUBLE, 0, 20,
SYNAPTICS_PROP_COASTING_SPEED,  0 /* float*/,   0},
+{"CoastingSpeed", PT_DOUBLE, 0, 255,
SYNAPTICS_PROP_COASTING_SPEED, 0 /* float*/,   0},
 {"CoastingFriction",  PT_DOUBLE, 0, 255,   
SYNAPTICS_PROP_COASTING_SPEED,  0 /* float*/,   1},
 {"PressureMotionMinZ",PT_INT,1, 255,   
SYNAPTICS_PROP_PRESSURE_MOTION, 32, 0},
 {"PressureMotionMaxZ",PT_INT,1, 255,   
SYNAPTICS_PROP_PRESSURE_MOTION, 32, 1},

commit ace20a02c371478f6a9d224dfd31ea219d91fc46
Author: Peter Hutterer 
Date:   Wed May 9 14:26:40 2012 +1000

Fix coasting speed trigger

CoastingSpeed is defined as scrolls/s. The previous code just used
delta/seconds which depended on the device coordinate range and exceeded the
default CoastingSpeed at almost any scroll event.

Divide the estimated delta by the scroll distance to get the accurate
scrolls/s number. Since that now changes the contents of what's in
coast_speed_y, change the users of that too.

http://bugzilla.redhat.com/813686

Signed-off-by: Peter Hutterer 
(cherry picked from commit 0de4445ff8e75aab208faf6383e76045934c6720)

diff --git a/src/synaptics.c b/src/synaptics.c
index ee627b3..30d79c5 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2456,7 +2456,7 @@ start_coasting(SynapticsPrivate * priv, struct 
SynapticsHwState *hw,
 double dy =
 estimate_delta(HIST(0).y, HIST(1).y, HIST(2).y, HIST(3).y);
 if (pkt_time > 0) {
-double scrolls_per_sec = dy / pkt_time;
+double scrolls_per_sec = (dy / abs(para->scroll_dist_vert)) / 
pkt_time;
 
 if (fabs(scrolls_per_sec) >= para->coasting_speed) {
 priv->scroll.coast_speed_y = scrolls_per_sec;
@@ -2468,7 +2468,7 @@ start_coasting(SynapticsPrivate * priv, struct 
SynapticsHwState *hw,
 double dx =
 estimate_delta(HIST(0).x, HIST(1).x, HIST(2).x, HIST(3).x);
 if (pkt_time > 0) {
-double scrolls_per_sec = dx / pkt_time;
+double scrolls_per_sec = (dx / abs(para->scroll_dist_vert)) / 
pkt_time;
 
 if (fabs(scrolls_per_sec) >= para->coasting_speed) {
 priv->scroll.coast_speed_x = scrolls_per_sec;
@@ -2480,7 +2480,7 @@ start_coasting(SynapticsPrivate * priv, struct 
SynapticsHwState *hw,
 double da = estimate_delta_circ(priv);
 
 if (pkt_time > 0) {
-double scrolls_per_sec = da / pkt_time;
+double scrolls_per_sec = (da / para->scroll_dist_circ) / 
pkt_time;
 
 if (fabs(scrolls_per_sec) >= p

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

2012-05-06 Thread Cyril Brulebois
 configure.ac  |8 ++--
 man/synaptics.man |5 +
 src/eventcomm.c   |2 +-
 src/synaptics.c   |   47 +--
 src/synproto.c|   27 +--
 src/synproto.h|3 ++-
 6 files changed, 76 insertions(+), 16 deletions(-)

New commits:
commit a1162f80324c379bc7581e53275e8ff6d569f8b0
Author: Peter Hutterer 
Date:   Thu May 3 08:06:32 2012 +1000

synaptics 1.6.0

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index 3238e32..e5b92f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.5.99.904],
+[1.6.0],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 52e194b76c9598e0fbf556e3aa97168ed4f0e2b6
Author: Peter Hutterer 
Date:   Wed May 2 10:16:30 2012 +1000

Fix coasting for negative scroll directions

1874094f0e99d8db319f6cf769ce5a25c9bc490c introduced negative scroll
directions. Coasting assumed always-positive increments and triggered an
endless scrolling loop.

Reported-by: Matthias Clasen 
Signed-off-by: Peter Hutterer 
Reviewed-by: Chase Douglas 

diff --git a/src/synaptics.c b/src/synaptics.c
index 6dc8004..77eb5be 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2625,7 +2625,8 @@ HandleScrolling(SynapticsPrivate *priv, struct 
SynapticsHwState *hw,
 
 if (priv->scroll.coast_speed_y) {
double dtime = (hw->millis - priv->scroll.last_millis) / 1000.0;
-   double ddy = para->coasting_friction * dtime * para->scroll_dist_vert;
+   double ddy = para->coasting_friction * dtime * 
abs(para->scroll_dist_vert);
+
priv->scroll.delta_y += priv->scroll.coast_speed_y * dtime;
delay = MIN(delay, POLL_MS);
if (abs(priv->scroll.coast_speed_y) < ddy) {
@@ -2638,7 +2639,7 @@ HandleScrolling(SynapticsPrivate *priv, struct 
SynapticsHwState *hw,
 
 if (priv->scroll.coast_speed_x) {
double dtime = (hw->millis - priv->scroll.last_millis) / 1000.0;
-   double ddx = para->coasting_friction * dtime * para->scroll_dist_horiz;
+   double ddx = para->coasting_friction * dtime * 
abs(para->scroll_dist_horiz);
priv->scroll.delta_x += priv->scroll.coast_speed_x * dtime;
delay = MIN(delay, POLL_MS);
if (abs(priv->scroll.coast_speed_x) < ddx) {

commit 6f086b86e4bd3c720289e91fdbb933bf3e559e72
Author: Peter Hutterer 
Date:   Wed May 2 09:16:27 2012 +1000

Fail if no backends can be found

Signed-off-by: Peter Hutterer 
Reviewed-by: Alan Coopersmith 
Reviewed-by: Chase Douglas 

diff --git a/configure.ac b/configure.ac
index dbf3fec..3238e32 100644
--- a/configure.ac
+++ b/configure.ac
@@ -120,7 +120,7 @@ case "${host}" in
BUILD_PS2COMM="yes"
;;
 *)
-   AC_MSG_RESULT([none])
+   AC_MSG_ERROR([Cannot find suitable backends for this platform.])
;;
 esac
 if test "x$BUILD_EVENTCOMM" = xyes; then

commit 655d3100fc3f06e714ec4aa01607d86509952e4b
Author: Niveditha Rau 
Date:   Mon Apr 30 14:51:07 2012 -0700

Include a build for solaris

Signed-off-by: Niveditha Rau 
Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index eaa1c98..dbf3fec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -115,6 +115,10 @@ case "${host}" in
BUILD_PS2COMM="yes"
BUILD_PSMCOMM="yes"
;;
+*solaris*)
+   AC_MSG_RESULT([ps2comm alpscomm])
+   BUILD_PS2COMM="yes"
+   ;;
 *)
AC_MSG_RESULT([none])
;;

commit d13e83b921a398b9472b07874cf5061c8a0ea6a6
Author: Peter Hutterer 
Date:   Mon Apr 30 11:39:49 2012 +1000

Force SLOTSTATE_EMPTY on DeviceOff

SLOTSTATE_OPEN_EMPTY on resume leads to erroneously detected touches.

Signed-off-by: Peter Hutterer 
Reviewed-by: Chase Douglas 

diff --git a/src/eventcomm.c b/src/eventcomm.c
index 741f988..4ef8ad6 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -662,7 +662,7 @@ EventReadHwState(InputInfoPtr pInfo,
 SynapticsParameters *para = &priv->synpara;
 struct eventcomm_proto_data *proto_data = priv->proto_data;
 
-SynapticsResetTouchHwState(hw);
+SynapticsResetTouchHwState(hw, FALSE);
 
 /* Reset cumulative values if buttons were not previously pressed */
 if (!hw->left && !hw->right && !hw->middle)
diff --git a/src/synaptics.c b/src/synaptics.c
index 935650d..6dc8004 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1619,7 +1619,7 @@ timerFunc(OsTimerPtr timer, CARD32 now, pointer arg)
 
 priv->hwState->millis += now - priv->timer_time;
 SynapticsCopyHwState(hw, priv->hwState);
-SynapticsResetTouchHwState(hw);
+SynapticsResetTouchHwState(hw, FALSE);
 delay = HandleState(pInfo, hw, hw->millis, TRUE);
 
 priv->timer_time = now;
@@ -1659,7 +1659,7 @@ ReadInput(InputInfoPtr pInfo

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

2012-04-27 Thread Cyril Brulebois
 conf/50-synaptics.conf |2 -
 configure.ac   |2 -
 man/synaptics.man  |   53 +-
 src/eventcomm.c|   29 +-
 src/synaptics.c|   98 +++--
 src/synapticsstr.h |1 
 src/synproto.c |   37 --
 tools/synclient.c  |   13 +-
 8 files changed, 146 insertions(+), 89 deletions(-)

New commits:
commit 085662e9fe13d46b9633f1b7b9e8f95bacdec30c
Author: Peter Hutterer 
Date:   Fri Apr 27 09:20:56 2012 +1000

synaptics 1.5.99.904

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index de136f2..eaa1c98 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.5.99.903],
+[1.5.99.904],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 58581bfbecfc15e7fa63c2fa4be20d2b0654f9b8
Author: Peter Hutterer 
Date:   Thu Apr 26 12:00:49 2012 +1000

Reset scroll delta when no finger is touching

Provides for a more consistent scrolling experience, otherwise delta
leftovers may trigger extra events even when the actual scrolling action
stays the same.

Signed-off-by: Peter Hutterer 
Reviewed-by: Chase Douglas 

diff --git a/src/synaptics.c b/src/synaptics.c
index 893a5c8..51ecda5 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2398,6 +2398,8 @@ HandleScrolling(SynapticsPrivate *priv, struct 
SynapticsHwState *hw,
 /* scroll detection */
 if (finger && priv->finger_state == FS_UNTOUCHED) {
stop_coasting(priv);
+priv->scroll.delta_y = 0;
+priv->scroll.delta_x = 0;
if (para->circular_scrolling) {
if ((para->circular_trigger == 0 && edge) ||
(para->circular_trigger == 1 && edge & TOP_EDGE) ||

commit 1a76d9f00e1e54ba912a47aa665968e0cfe1b8a0
Author: Peter Hutterer 
Date:   Thu Apr 26 11:47:19 2012 +1000

Don't unconditionally divide by scroll_dist_vert (#46617)

Regression introduced in cddab79c408db3b13905a2be72aff4f7bf1406f8.

If an event has a delta of less than scroll_dist_vert, the delta is
unconditionally divided by the distance, leaving some remainder close to 0
and never actually triggering the scroll amount.

Fix this by working with the increment, not the normalised values.

X.Org Bug 46617 

Signed-off-by: Peter Hutterer 
Reviewed-by: Chase Douglas 

diff --git a/src/synaptics.c b/src/synaptics.c
index 2a43f95..893a5c8 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2864,31 +2864,29 @@ post_scroll_events(const InputInfoPtr pInfo)
 SynapticsParameters *para = &priv->synpara;
 
 /* smooth scrolling uses the dist as increment */
-priv->scroll.delta_y /= para->scroll_dist_vert;
-priv->scroll.delta_x /= para->scroll_dist_horiz;
 
-while (priv->scroll.delta_y <= -1.0)
+while (priv->scroll.delta_y <= -para->scroll_dist_vert)
 {
 post_button_click(pInfo, 4);
-priv->scroll.delta_y += 1.0;
+priv->scroll.delta_y += para->scroll_dist_vert;
 }
 
-while (priv->scroll.delta_y >= 1.0)
+while (priv->scroll.delta_y >= para->scroll_dist_vert)
 {
 post_button_click(pInfo, 5);
-priv->scroll.delta_y -= 1.0;
+priv->scroll.delta_y -= para->scroll_dist_vert;
 }
 
-while (priv->scroll.delta_x <= -1.0)
+while (priv->scroll.delta_x <= -para->scroll_dist_horiz)
 {
 post_button_click(pInfo, 6);
-priv->scroll.delta_x += 1.0;
+priv->scroll.delta_x += para->scroll_dist_horiz;
 }
 
-while (priv->scroll.delta_x >= 1.0)
+while (priv->scroll.delta_x >= para->scroll_dist_horiz)
 {
 post_button_click(pInfo, 7);
-priv->scroll.delta_x -= 1.0;
+priv->scroll.delta_x -= para->scroll_dist_horiz;
 }
 #endif
 }
@@ -2934,13 +2932,13 @@ repeat_scrollbuttons(const InputInfoPtr pInfo,
id = ffs(change);
change &= ~(1 << (id - 1));
if (id == 4)
-   priv->scroll.delta_y -= 1.0;
+   priv->scroll.delta_y -= para->scroll_dist_vert;
else if (id == 5)
-   priv->scroll.delta_y += 1.0;
+   priv->scroll.delta_y += para->scroll_dist_vert;
else if (id == 6)
-   priv->scroll.delta_x -= 1.0;
+   priv->scroll.delta_x -= para->scroll_dist_horiz;
else if (id == 7)
-   priv->scroll.delta_x += 1.0;
+   priv->scroll.delta_x += para->scroll_dist_horiz;
}
 
priv->nextRepeat = now + repeat_delay;

commit ba31b09ba8aff6b8f3b0590e724183b0d2802ffc
Author: Peter Hutterer 
Date:   Thu Apr 26 10:03:28 20

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

2012-04-01 Thread Cyril Brulebois
 conf/50-synaptics.conf |   18 +
 configure.ac   |2 -
 man/synaptics.man  |2 +
 src/eventcomm.c|3 +-
 src/synaptics.c|   51 +++--
 src/synapticsstr.h |2 -
 src/synproto.c |   13 +++-
 src/synproto.h |1 
 8 files changed, 78 insertions(+), 14 deletions(-)

New commits:
commit 4a80c0dc38ea4dafcb112191c2dd7e0082193263
Author: Peter Hutterer 
Date:   Fri Mar 23 10:38:20 2012 +1000

synaptics 1.5.99.902

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index af1bc2a..0a85d13 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.5.99.901],
+[1.5.99.902],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit b6779458bcdb049480310ba1acb3991ad061ffc7
Author: Peter Hutterer 
Date:   Thu Mar 22 15:15:47 2012 +1000

conf: enable right-button click by default on non-Apple clickpads

The right-half of the bottom 18% of the touchpad are enabled as right button
by default. On Apple touchpads (these don't have marking for the right
button) disable them by default.

Signed-off-by: Peter Hutterer 

diff --git a/conf/50-synaptics.conf b/conf/50-synaptics.conf
index 5ec7e78..822f7a4 100644
--- a/conf/50-synaptics.conf
+++ b/conf/50-synaptics.conf
@@ -24,3 +24,21 @@ Section "InputClass"
 MatchDevicePath "/dev/input/mouse*"
 Option "Ignore" "on"
 EndSection
+
+# This option enables the bottom right corner to be a right button on
+# non-synaptics clickpads.
+# This option is only interpreted by clickpads.
+Section "InputClass"
+Identifier "Default clickpad buttons"
+MatchDriver "synaptics"
+Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
+EndSection
+
+# This option disables software buttons on Apple touchpads.
+# This option is only interpreted by clickpads.
+Section "InputClass"
+Identifier "Disable clickpad buttons on Apple touchpads"
+MatchProduct "Apple"
+MatchDriver "synaptics"
+Option "SoftButtonAreas" "0 0 0 0 0 0 0 0"
+EndSection

commit c9cf8827b129a553ad3cd3d7ee6f463a6e94227d
Author: Peter Hutterer 
Date:   Thu Mar 22 15:20:45 2012 +1000

use xf86SetStrOption for SoftButtonAreas

This way the option is reported in the log when parsed.

Signed-off-by: Peter Hutterer 

diff --git a/src/synaptics.c b/src/synaptics.c
index 789de81..f07fd13 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -521,7 +521,7 @@ static void set_softbutton_areas_option(InputInfoPtr pInfo)
 if (!pars->clickpad)
 return;
 
-option_string = xf86CheckStrOption(pInfo->options, "SoftButtonAreas", 
NULL);
+option_string = xf86SetStrOption(pInfo->options, "SoftButtonAreas", NULL);
 if (!option_string)
 return;
 

commit cea97dd5e09b165c2a4b25741a03f152ed37
Author: Peter Hutterer 
Date:   Wed Mar 14 16:47:26 2012 +1000

Allow soft button areas to be specified in % of the touchpad

Signed-off-by: Peter Hutterer 
Reviewed-by: Chase Douglas 

diff --git a/man/synaptics.man b/man/synaptics.man
index 23862e3..864a95f 100644
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -526,6 +526,8 @@ parameters define the area of the right button, and the 
second four parameters
 define the area of the middle button. The areas are defined by the left, right,
 top, and bottom edges as sequential values of the property. If any edge is set
 to 0, the button is assumed to extend to infinity in the given direction.
+Any of the values may be given as percentage of the touchpad width or
+height, whichever applies.
 .
 When the user performs a click within the defined soft button areas, the right
 or middle click action is performed.
diff --git a/src/synaptics.c b/src/synaptics.c
index 3c5b12d..789de81 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -511,10 +511,12 @@ static void set_softbutton_areas_option(InputInfoPtr 
pInfo)
 SynapticsPrivate *priv = pInfo->private;
 SynapticsParameters *pars = &priv->synpara;
 int values[8];
+int in_percent = 0; /* bitmask for which ones are in % */
 char *option_string;
 char *next_num;
 char *end_str;
 int i;
+int width, height;
 
 if (!pars->clickpad)
 return;
@@ -534,12 +536,36 @@ static void set_softbutton_areas_option(InputInfoPtr 
pInfo)
 values[i] = value;
 
 if (next_num != end_str)
+{
+if (end_str && *end_str == '%')
+{
+in_percent |= 1 << i;
+end_str++;
+}
 next_num = end_str;
-else
+} else
 goto fail;
 }
 
-if (i < 8 || *next_num != '\0' || !SynapticsIsSoftButtonAreasValid(values))
+if (i < 8 || *next_num !

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

2012-03-20 Thread Cyril Brulebois
Rebased ref, commits from common ancestor:
commit dd650a064b98b1c325a38e1370cc11059c257b07
Author: Peter Hutterer 
Date:   Wed Mar 14 08:56:45 2012 +1000

synaptics 1.5.99.901

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index 29f6e68..af1bc2a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.5.99],
+[1.5.99.901],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit fee18d8567efd2e5abf6b29eb1ae9ee0e3858013
Author: Peter Hutterer 
Date:   Tue Mar 13 16:08:12 2012 +1000

Soft buttons are only available on clickpad devices, disable them otherwise.

If the clickpad support is runtime enabled/disabled, the property
appears/disappears accordingly.

Signed-off-by: Peter Hutterer 
Reviewed-by: Chase Douglas 

diff --git a/man/synaptics.man b/man/synaptics.man
index aaec35f..23862e3 100644
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -520,6 +520,7 @@ the total height of the touchpad. Property: "Synaptics Area"
 .
 .TP
 .BI "Option \*qSoftButtonAreas\*q \*q" "RBL RBR RBT RBB MBL MBR MBT MBB" \*q
+This option is only available on ClickPad devices.
 Enable soft button click area support on ClickPad devices. The first four
 parameters define the area of the right button, and the second four parameters
 define the area of the middle button. The areas are defined by the left, right,
@@ -942,6 +943,7 @@ default.
 
 .TP 7
 .BI "Synaptics Soft Button Areas"
+This property is only available on ClickPad devices.
 The Right and middle soft button areas are used to support right and middle
 click actions on a ClickPad device. Providing 0 for all values of a given 
button
 disables the button area.
diff --git a/src/properties.c b/src/properties.c
index 5cd3088..783b516 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -151,6 +151,24 @@ InitFloatAtom(DeviceIntPtr dev, char *name, int nvalues, 
float *values)
 return atom;
 }
 
+static void
+InitSoftButtonProperty(InputInfoPtr pInfo)
+{
+SynapticsPrivate *priv = (SynapticsPrivate *) pInfo->private;
+SynapticsParameters *para = &priv->synpara;
+int values[8];
+
+values[0] = para->softbutton_areas[0][0];
+values[1] = para->softbutton_areas[0][1];
+values[2] = para->softbutton_areas[0][2];
+values[3] = para->softbutton_areas[0][3];
+values[4] = para->softbutton_areas[1][0];
+values[5] = para->softbutton_areas[1][1];
+values[6] = para->softbutton_areas[1][2];
+values[7] = para->softbutton_areas[1][3];
+prop_softbutton_areas = InitAtom(pInfo->dev, 
SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 8, values);
+}
+
 void
 InitDeviceProperties(InputInfoPtr pInfo)
 {
@@ -301,15 +319,8 @@ InitDeviceProperties(InputInfoPtr pInfo)
 values[3] = para->area_bottom_edge;
 prop_area = InitAtom(pInfo->dev, SYNAPTICS_PROP_AREA, 32, 4, values);
 
-values[0] = para->softbutton_areas[0][0];
-values[1] = para->softbutton_areas[0][1];
-values[2] = para->softbutton_areas[0][2];
-values[3] = para->softbutton_areas[0][3];
-values[4] = para->softbutton_areas[1][0];
-values[5] = para->softbutton_areas[1][1];
-values[6] = para->softbutton_areas[1][2];
-values[7] = para->softbutton_areas[1][3];
-prop_softbutton_areas = InitAtom(pInfo->dev, 
SYNAPTICS_PROP_SOFTBUTTON_AREAS, 32, 8, values);
+if (para->clickpad)
+InitSoftButtonProperty(pInfo);
 
 values[0] = para->hyst_x;
 values[1] = para->hyst_y;
@@ -407,9 +418,20 @@ SetProperty(DeviceIntPtr dev, Atom property, 
XIPropertyValuePtr prop,
 para->tap_time_2 = timeouts[1];
 para->click_time = timeouts[2];
 } else if (property == prop_clickpad) {
+BOOL value;
+
 if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
 return BadMatch;
 
+value = *(BOOL*)prop->data;
+if (!para->clickpad && value && !prop_softbutton_areas)
+InitSoftButtonProperty(pInfo);
+else if (para->clickpad && !value && prop_softbutton_areas)
+{
+XIDeleteDeviceProperty(dev, prop_softbutton_areas, FALSE);
+prop_softbutton_areas = 0;
+}
+
 para->clickpad = *(BOOL*)prop->data;
 } else if (property == prop_tap_fast)
 {
diff --git a/src/synaptics.c b/src/synaptics.c
index 4275d2a..898130e 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -516,6 +516,9 @@ static void set_softbutton_areas_option(InputInfoPtr pInfo)
 char *end_str;
 int i;
 
+if (!pars->clickpad)
+return;
+
 option_string = xf86CheckStrOption(pInfo->options, "SoftButtonAreas", 
NULL);
 if (!option_string)
 return;

commit c546779b32d8be23475b3b062e3ebc9235365c0d
Author: Chase Douglas 
Date:   Thu Feb 9 16:56:29 2012 -0800

Ignore motion during touch coun

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

2011-11-11 Thread Cyril Brulebois
Rebased ref, commits from common ancestor:


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/e1roz4o-0003sl...@vasks.debian.org



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

2011-09-05 Thread Timo Aaltonen
 Makefile.am|8 
 conf/50-synaptics.conf |8 
 configure.ac   |   36 ++-
 include/Makefile.am|1 
 man/Makefile.am|3 
 man/syndaemon.man  |   41 +++-
 src/Makefile.am|9 
 src/alpscomm.c |   13 -
 src/alpscomm.h |   33 ---
 src/eventcomm.c|  374 
 src/eventcomm.h|6 
 src/properties.c   |   35 +++
 src/ps2comm.c  |   91 -
 src/ps2comm.h  |   13 +
 src/psmcomm.c  |   37 +---
 src/synaptics.c|  234 +
 src/synapticsstr.h |   12 -
 src/synproto.h |   21 --
 test/.gitignore|6 
 test/Makefile.am   |   15 +
 test/eventcomm-test.c  |  285 ++
 test/fake-symbols.c|  452 +
 test/fake-symbols.h|  178 +++
 test/test-pad.c|  121 -
 test/testprotocol.c|   82 
 tools/Makefile.am  |3 
 tools/synclient.c  |1 
 tools/syndaemon.c  |7 
 28 files changed, 1497 insertions(+), 628 deletions(-)

New commits:
commit 065a0b495d2a7eb76b61f9eec85248aefae4c8ee
Author: Peter Hutterer 
Date:   Fri Sep 2 16:04:07 2011 +1000

synaptics 1.5.0

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index 09306ec..f13fcdd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.4.99.1],
+[1.5.0],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 3489e2467d43217971f17b9344fc2772cc0f164d
Author: Alexandr Shadchin 
Date:   Fri Aug 26 18:42:08 2011 +0600

The correct maximum values for pressure and finger width

Signed-off-by: Alexandr Shadchin 
Signed-off-by: Peter Hutterer 
(cherry picked from commit 7a72af1ce105fd857214bb641a8fa2cfd150a5f7)

diff --git a/src/synaptics.c b/src/synaptics.c
index cf91b9f..d036bdf 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -231,7 +231,7 @@ SanitizeDimensions(InputInfoPtr pInfo)
 if (priv->minp >= priv->maxp)
 {
priv->minp = 0;
-   priv->maxp = 256;
+   priv->maxp = 255;
 
xf86IDrvMsg(pInfo, X_PROBED,
"invalid pressure range.  defaulting to %d - %d\n",
@@ -241,7 +241,7 @@ SanitizeDimensions(InputInfoPtr pInfo)
 if (priv->minw >= priv->maxw)
 {
priv->minw = 0;
-   priv->maxw = 16;
+   priv->maxw = 15;
 
xf86IDrvMsg(pInfo, X_PROBED,
"invalid finger width range.  defaulting to %d - %d\n",
@@ -444,7 +444,7 @@ static void set_default_parameters(InputInfoPtr pInfo)
 horizHyst = pars->hyst_x >= 0 ? pars->hyst_x : diag * 0.005;
 vertHyst = pars->hyst_y >= 0 ? pars->hyst_y : diag * 0.005;
 
-range = priv->maxp - priv->minp;
+range = priv->maxp - priv->minp + 1;
 
 /* scaling based on defaults and a pressure of 256 */
 fingerLow = priv->minp + range * (25.0/256);
@@ -457,7 +457,7 @@ static void set_default_parameters(InputInfoPtr pInfo)
 pressureMotionMaxZ = priv->minp + range * (160.0/256);
 palmMinZ = priv->minp + range * (200.0/256);
 
-range = priv->maxw - priv->minw;
+range = priv->maxw - priv->minw + 1;
 
 /* scaling based on defaults below and a tool width of 16 */
 palmMinWidth = priv->minw + range * (10.0/16);

commit 98e8481cf4911506403b8963fc32c61a74cf679e
Author: Peter Hutterer 
Date:   Fri Aug 19 15:57:08 2011 +1000

Bump to 1.4.99.1

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index adbf594..09306ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.4.99],
+[1.4.99.1],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit dd6c51499e626b1bc3ddd82949691efa667ff1c4
Author: Peter Hutterer 
Date:   Thu Jul 28 11:02:45 2011 +1000

syndaemon: Remove superfluous message.

toggle_touchpad() already prints if we're running verbose.

Signed-off-by: Peter Hutterer 

diff --git a/tools/syndaemon.c b/tools/syndaemon.c
index d527b76..bead545 100644
--- a/tools/syndaemon.c
+++ b/tools/syndaemon.c
@@ -449,7 +449,6 @@ void record_main_loop(Display* display, double idle_time) {
 
if (ret == 0 && pad_disabled) { /* timeout => enable event */
toggle_touchpad(True);
-   if (verbose) printf("enable touchpad\n");
}
 
 } /* end while(1) */

commit ba53d850252165ba96e7abc6e7dd0648b40ee37b
Author: Peter Hutterer 
Date:   Thu Jul 28 10:57:12 2011 +1000

syndaemon: document exit codes and change them to fall into categories.

Changing pid file creation failure

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

2011-07-01 Thread Cyril Brulebois
 README |6 +++---
 conf/11-x11-synaptics.fdi  |   10 +++---
 conf/50-synaptics.conf |   13 +
 configure.ac   |2 +-
 include/synaptics-properties.h |4 ++--
 man/synaptics.man  |   23 ---
 src/eventcomm.c|1 +
 src/synaptics.c|2 +-
 src/synapticsstr.h |2 +-
 tools/syndaemon.c  |   37 ++---
 10 files changed, 63 insertions(+), 37 deletions(-)

New commits:
commit a1c77348563d882a5da870d6884ee91434458689
Author: Peter Hutterer 
Date:   Tue Jun 28 14:47:04 2011 +1000

synaptics 1.4.1

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index 8558e5b..01ca49b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.4.0.901],
+[1.4.1],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 65c8d5c703b2f9a65e3bf86b1ad35a0d439b46aa
Author: Peter Hutterer 
Date:   Mon May 23 10:18:22 2011 +1000

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 

Signed-off-by: Peter Hutterer 
(cherry picked from commit be83094bd98c353b0ee7894eefcb1ae91e0cae30)

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);

commit 11b70094aa66a85bc06e5c160cdc15139df94cb7
Author: Peter Hutterer 
Date:   Mon May 23 10:12:42 2011 +1000

syndaemon: fix abysimal indentation in dp_get_device.

Signed-off-by: Peter Hutterer 
(cherry picked from commit e4958186fae78770bc739be701b849f28c87cf11)

diff --git a/tools/syndaemon.c b/tools/syndaemon.c
index 47e0e6a..327f479 100644
--- a/tools/syndaemon.c
+++ b/tools/syndaemon.c
@@ -487,24 +487,24 @@ dp_get_device(Display *dpy)
properties = XListDeviceProperties(dpy, dev, &nprops);
if (!properties || !nprops)
{
- fprintf(stderr, "No properties on device '%s'.\n",
- info[ndevices].name);
- error = 1;
- goto unwind;
-  }
+   fprintf(stderr, "No properties on device '%s'.\n",
+   info[ndevices].name);
+   error = 1;
+   goto unwind;
+   }
 
while(nprops--)
{
- if (properties[nprops] == synaptics_property)
- break;
-  }
+   if (properties[nprops] == synaptics_property)
+   break;
+   }
if (!nprops)
{
- fprintf(stderr, "No synaptics properties on device '%s'.\n",
- info[ndevices].name);
- error = 1;
- goto unwind;
-  }
+   fprintf(stderr, "No synaptics properties on device '%s'.\n",
+   info[ndevices].name);
+   error = 1;
+   goto unwind;
+   }
 
break; /* Yay, device is suitable */
}

commit ee216923ddaf4492c7e1eb026fa0b4f5e8ed5ec9
Author: Peter Hutterer 
Date:   Thu May 19 09:45:10 2011 +1000

include: update documentation for capabilities property

pressure and width were added recently

Signed-off-by: Peter Hutterer 
(cherry picked from commit 0c8971c80c21d7541d9614ac67a8d4954d4859ec)

diff --git a/include/synaptics-properties.h b/include/synaptics-properties.h
index bdb2112..77a1806 100644
--- a/include/synaptics-properties.h
+++ b/include/synaptics-properties.h
@@ -145,8 +145,8 @@
 /* 8 bit (BOOL), 1 value, tap-and-drag */
 #define SYNAPTICS_PROP_GESTURES "Synaptics Gestures"
 
-/* 8 bit (BOOL), 5 values (read-only), has_left, has_middle, has_right,
- * has_double, has_triple */
+/* 8 bit (BOOL),

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

2011-03-05 Thread Cyril Brulebois
 configure.ac  |2 +-
 src/psmcomm.c |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit de0dfb76444ad4160468d00515876c91a9fa20bf
Author: Peter Hutterer 
Date:   Fri Mar 4 12:36:24 2011 +1000

synaptics 1.4.0

Signed-off-by: Peter Hutterer 

diff --git a/configure.ac b/configure.ac
index ea66935..c057ffb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-synaptics],
-[1.3.99.901],
+[1.4.0],
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit fefb3b63c589b0758c02777e652f05e537ba663f
Author: Julien Cristau 
Date:   Fri Feb 25 20:41:12 2011 +0100

Fix build on BSD

local was renamed to pInfo in 81ad2e389d11691d5c2687d83150e8e9033cfe76,
but a couple places were missed.

Signed-off-by: Julien Cristau 
Signed-off-by: Peter Hutterer 

diff --git a/src/psmcomm.c b/src/psmcomm.c
index 66e8d1e..741cd1d 100644
--- a/src/psmcomm.c
+++ b/src/psmcomm.c
@@ -147,7 +147,7 @@ PSMQueryHardware(InputInfoPtr pInfo)
 synhw = (struct SynapticsHwInfo*)priv->proto_data;
 
 /* is the synaptics touchpad active? */
-if (!PSMQueryIsSynaptics(local))
+if (!PSMQueryIsSynaptics(pInfo))
return FALSE;
 
 xf86Msg(X_PROBED, "%s synaptics touchpad found\n", pInfo->name);
@@ -167,7 +167,7 @@ PSMReadHwState(InputInfoPtr pInfo,
   struct SynapticsProtocolOperations *proto_ops,
   struct CommData *comm, struct SynapticsHwState *hwRet)
 {
-return psaux_proto_operations.ReadHwState(local, proto_ops, comm, hwRet);
+return psaux_proto_operations.ReadHwState(pInfo, proto_ops, comm, hwRet);
 }
 
 static Bool PSMAutoDevProbe(InputInfoPtr pInfo)


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/e1pvtd7-0007xn...@alioth.debian.org



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

2011-02-20 Thread Cyril Brulebois
New branch 'upstream-unstable' available with the following commits:


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/e1prmsj-0008au...@alioth.debian.org