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

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



 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 <peter.hutterer@who-t.net>
Date:   Fri Apr 27 09:20:56 2012 +1000

    synaptics 1.5.99.904
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

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 <peter.hutterer@who-t.net>
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 <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>

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 <peter.hutterer@who-t.net>
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 <http://bugs.freedesktop.org/show_bug.cgi?id=46617>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>

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 <peter.hutterer@who-t.net>
Date:   Thu Apr 26 10:03:28 2012 +1000

    ClickPad is most definitely a bool option.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>

diff --git a/src/synaptics.c b/src/synaptics.c
index d2fe960..2a43f95 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -702,7 +702,7 @@ static void set_default_parameters(InputInfoPtr pInfo)
     pars->tap_move = xf86SetIntOption(opts, "MaxTapMove", tapMove);
     pars->tap_time_2 = xf86SetIntOption(opts, "MaxDoubleTapTime", 180);
     pars->click_time = xf86SetIntOption(opts, "ClickTime", 100);
-    pars->clickpad = xf86SetIntOption(opts, "ClickPad", pars->clickpad); /* Probed */
+    pars->clickpad = xf86SetBoolOption(opts, "ClickPad", pars->clickpad); /* Probed */
     pars->fast_taps = xf86SetBoolOption(opts, "FastTaps", FALSE);
     /* middle mouse button emulation on a clickpad? nah, you're joking */
     middle_button_timeout = pars->clickpad ? 0 : 75;

commit f0c2f1d82a21de315a0088dd28ffeb394cf32c8e
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Apr 26 09:27:05 2012 +1000

    Init num_touches to 0 on start
    
    We implicitly rely on this already since we calloc the struct. Do it
    expliclity on DeviceOn().
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>

diff --git a/src/eventcomm.c b/src/eventcomm.c
index 5707e38..741f988 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -150,6 +150,7 @@ InitializeTouch(InputInfoPtr pInfo)
     }
 
     proto_data->cur_slot = proto_data->mtdev->caps.slot.value;
+    proto_data->num_touches = 0;
 
     proto_data->last_mt_vals = calloc(priv->num_slots,
                                       sizeof(ValuatorMask *));

commit 9ecf505c6473c65cd850a58b1b6eeb86f7d390e6
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Apr 24 15:31:36 2012 +1000

    Reset touch state on DeviceOff (#49161)
    
    Don't leave touches lingering around during suspend.
    
    Test case:
    1) leave finger on touchpad
    2) xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 0
    3) lift fingers
    4) xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 1
    
    X.Org Bug 49161 <http://bugs.freedesktop.org/show_bug.cgi?id=49161>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>

diff --git a/src/eventcomm.c b/src/eventcomm.c
index 9d1233c..5707e38 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -128,6 +128,7 @@ UninitializeTouch(InputInfoPtr pInfo)
 
     mtdev_close(proto_data->mtdev);
     proto_data->mtdev = NULL;
+    proto_data->num_touches = 0;
 }
 
 static void
diff --git a/src/synaptics.c b/src/synaptics.c
index 853bfa8..d2fe960 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1086,6 +1086,7 @@ DeviceOff(DeviceIntPtr dev)
     if (pInfo->fd != -1) {
 	TimerCancel(priv->timer);
 	xf86RemoveEnabledDevice(pInfo);
+        SynapticsResetTouchHwState(priv->hwState);
         if (priv->proto_ops->DeviceOffHook &&
             !priv->proto_ops->DeviceOffHook(pInfo))
             rc = !Success;

commit f300adb027b856c944e0e25d0f32948823fe6b62
Author: Chase Douglas <chase.douglas@canonical.com>
Date:   Mon Apr 23 15:39:57 2012 -0700

    Update src/synproto.c license to the preferred MIT/X11 license
    
    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/synproto.c b/src/synproto.c
index 19a13e5..4f44f4d 100644
--- a/src/synproto.c
+++ b/src/synproto.c
@@ -1,29 +1,24 @@
 /*
  * Copyright � 2012 Canonical, Ltd.
  *
- * 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.
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * 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.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
  *
- * Authors:
- *      Chase Douglas <chase.douglas@canonical.com>
- *
- * Trademarks are the property of their respective owners.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER 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.
  */
 
 

commit 5a176dc23d7dfb4648fef50ac0af144026b45078
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Apr 20 11:13:16 2012 +1000

    Don't release the button on TS_3 if TapAndDrag is disabled (#31854)
    
    TS_3 is second tap down. Unconditionally set the button as down, later, in
    HandleTapProcessing we have the required conditions to reset it to TS_START
    and TBS_BUTTON_UP.
    
    Meanwhile, TBS_BUTTON_DOWN stays down, so the second tap is counted and sent
    as button event. This restores double-tapping if TapAndDrag is disabled.
    
    X.Org Bug 31854 <http://bugs.freedesktop.org/show_bug.cgi?id=31854>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/synaptics.c b/src/synaptics.c
index 0de5c01..853bfa8 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1865,10 +1865,7 @@ SetTapState(SynapticsPrivate *priv, enum TapState tap_state, CARD32 millis)
 	priv->tap_button_state = TBS_BUTTON_UP;
 	break;
     case TS_3:
-	if (para->tap_and_drag_gesture)
-	    priv->tap_button_state = TBS_BUTTON_DOWN;
-	else
-	    priv->tap_button_state = TBS_BUTTON_UP;
+	priv->tap_button_state = TBS_BUTTON_DOWN;
 	break;
     case TS_SINGLETAP:
 	if (para->fast_taps)

commit 0322d301844a7e78fc9aa4ec6493bf50bc7f926c
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Apr 20 11:10:47 2012 +1000

    Print millis as unsigned int
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/synaptics.c b/src/synaptics.c
index 8c34234..0de5c01 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1846,7 +1846,7 @@ static void
 SetTapState(SynapticsPrivate *priv, enum TapState tap_state, CARD32 millis)
 {
     SynapticsParameters *para = &priv->synpara;
-    DBG(7, "SetTapState - %d -> %d (millis:%d)\n", priv->tap_state, tap_state, millis);
+    DBG(3, "SetTapState - %d -> %d (millis:%u)\n", priv->tap_state, tap_state, millis);
     switch (tap_state) {
     case TS_START:
 	priv->tap_button_state = TBS_BUTTON_UP;
@@ -1886,7 +1886,7 @@ SetTapState(SynapticsPrivate *priv, enum TapState tap_state, CARD32 millis)
 static void
 SetMovingState(SynapticsPrivate *priv, enum MovingState moving_state, CARD32 millis)
 {
-    DBG(7, "SetMovingState - %d -> %d center at %d/%d (millis:%d)\n", priv->moving_state,
+    DBG(7, "SetMovingState - %d -> %d center at %d/%d (millis:%u)\n", priv->moving_state,
 		  moving_state,priv->hwState->x, priv->hwState->y, millis);
 
     if (moving_state == MS_TRACKSTICK) {

commit 3822d58777768b351940e58d8608ba9ab877d134
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Thu Apr 19 16:39:41 2012 +1000

    Ensure hw millis are monotonic (#48777)
    
    The eventcomm backend takes the timestamp from the kernel, but the timer
    uses the timer's "now". This timestamp may be later than the one from the
    next event we read from the kernel, causing a negative dtime in get_delta()
    and a cursor jump by (unsigned int)-1.
    
    Ensure that the new event's timestamp is at least the last used one.
    
    X.Org Bug 48777 <http://bugs.freedesktop.org/show_bug.cgi?id=48777>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Tested-by: Gavin Troy <gavtroy@gmail.com>

diff --git a/src/synaptics.c b/src/synaptics.c
index 350567d..8c34234 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1635,6 +1635,10 @@ ReadInput(InputInfoPtr pInfo)
 	    hw->cumulative_dy = priv->hwState->cumulative_dy;
 	}
 
+	/* timer may cause actual events to lag behind (#48777) */
+	if (priv->hwState->millis > hw->millis)
+	    hw->millis = priv->hwState->millis;
+
 	SynapticsCopyHwState(priv->hwState, hw);
 	delay = HandleState(pInfo, hw, hw->millis, FALSE);
 	newDelay = TRUE;

commit 11d8929647a67258ca86121a45ea638ca7299237
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Apr 18 09:30:06 2012 +1000

    man: move ClickPad documentation into a single area
    
    Having to read only one section is a tad easier than collecting the separate
    options.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>

diff --git a/man/synaptics.man b/man/synaptics.man
index 2cbe50e..110ad6c 100644
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -144,10 +144,9 @@ The duration of the mouse click generated by tapping. Property: "Synaptics Tap
 Durations"
 .TP 7
 .BI "Option \*qClickPad\*q \*q" boolean \*q
-Whether the device is a click pad. A click pad device has button(s) integrated
-into the touchpad surface. The user must press downward on the touchpad in order
-to generated a button press. This property may be set automatically if a click
-pad device is detected at initialization time. Property: "Synaptics ClickPad"
+Whether the device is a click pad. See
+.B ClickPad support
+for more details. Property: "Synaptics ClickPad"
 .TP 7
 .BI "Option \*qFastTaps\*q \*q" boolean \*q
 Makes the driver react faster to a single tap, but also makes double
@@ -520,20 +519,15 @@ 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,
-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.
-.
-The use of soft button areas is disabled by setting all the values for the area
-to 0. Property: "Synaptics Soft Button Areas"
+This option is only available on ClickPad devices. 
+Enable soft button click area support on ClickPad devices. 
+The first four parameters are the left, right, top, bottom edge of the right
+button, respectively, the second four parameters are the left, right, top,
+bottom edge of the middle button, respectively. Any of the values may be
+given as percentage of the touchpad width or height, whichever applies.
+If any edge is set to 0, the button is assumed to extend to infinity in the
+given direction. Setting all values to 0 disables soft button areas.
+Property: "Synaptics Soft Button Areas"
 .
 
 .SH CONFIGURATION DETAILS
@@ -782,6 +776,26 @@ Trackstick mode is exited when the finger pressure drops below
 FingerLow or when the finger is moved further than MaxTapMove away
 from the initial position.
 
+.SS ClickPad support
+A click pad device has button(s) integrated into the touchpad surface. The
+user must press downward on the touchpad in order to generated a button
+press. ClickPad support is enabled if the option
+.B ClickPad
+is set or the property is set at runtime. On some platforms, this option
+will be set automatically if the kernel detects a matching device. On Linux,
+the device must have the INPUT_PROP_BUTTONPAD property set.
+.LP
+ClickPads do not support middle mouse button emulation. If enabling ClickPad
+support at runime, the user must also set the middle mouse button timeout to
+0. If auto-detected, middle mouse button emulation is disabled by the
+driver.
+.LP
+ClickPads provide software emulated buttons through 
+.B Option SoftButtonAreas.
+These buttons enable areas on the touchpad to perform as right or middle
+mouse button. When the user performs a click within a defined soft button
+area, a right or middle click is performed.
+
 .SH "DEVICE PROPERTIES"
 Synaptics 1.0 and higher support input device properties if the driver is
 running on X server 1.6 or higher. On these driver versions, Option

commit 1c155f644824133315ac5b3dac9076db71430eb6
Author: Chow Loong Jin <hyperair@debian.org>
Date:   Mon Apr 16 11:39:44 2012 +0800

    Fix coasting friction
    
    As a result of commit 5a1612d4496b51682c9043aa064025c545249de6, coasting speed
    was bumped up to a different scale by removing the divisor during the
    calculation of initial coasting speed. This caused coasting friction to have
    little to no effect, resulting in coasting that lasted virtually forever using
    the default coasting friction value of 50.
    
    This patch multiplies the scroll_dist_{horiz,vert} which was previously used as
    a divisor for initial coasting speed to the coasting friction before deducting
    it at each step, thus bringing coasting friction back under control.
    
    Signed-off-by: Chow Loong Jin <hyperair@debian.org>
    Tested-by: <Magnus.Kessler@gmx.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/synaptics.c b/src/synaptics.c
index 2ea7375..350567d 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2587,7 +2587,7 @@ 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;
+	double ddy = para->coasting_friction * dtime * 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) {
@@ -2600,7 +2600,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;
+	double ddx = para->coasting_friction * dtime * 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 50124d3ddf9bbc4be6734b47a273dbd46b4db0ba
Author: Pierre Lulé <pierre@lule.fr>
Date:   Mon Apr 16 12:01:56 2012 +0200

    Stop coasting when two-finger scroll begins
    
    There is currently a problem that can lead the coasting to continue while scrolling in a particular situation :
    with
     Option "VertTwoFingerScroll" "on"
     Option "CornerCoasting" "0"
     Option "CoastingSpeed" "10"
     Option "CoastingFriction" "50"
     Option "CornerCoasting" "0"
    If you scroll down with two finger then raise a finger, coasting will start. But if you put down that finger and try to
    scroll up, the inertia will still scroll down while you scroll up. This can look like a very particular situation, but
    happens to me often while scrolling in a big document.
    
    This (awfully simple) patch stop coasting when detecting two-finger scroll.
    
    Signed-off-by: Pierre Lulé <pierre@lule.fr>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/synaptics.c b/src/synaptics.c
index 40478ec..2ea7375 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2418,6 +2418,7 @@ HandleScrolling(SynapticsPrivate *priv, struct SynapticsHwState *hw,
 	    if (hw->numFingers == 2) {
 		if (!priv->vert_scroll_twofinger_on &&
 		    (para->scroll_twofinger_vert) && (para->scroll_dist_vert != 0)) {
+		    stop_coasting(priv);
 		    priv->vert_scroll_twofinger_on = TRUE;
 		    priv->vert_scroll_edge_on = FALSE;
 		    priv->scroll.last_y = hw->y;
@@ -2425,6 +2426,7 @@ HandleScrolling(SynapticsPrivate *priv, struct SynapticsHwState *hw,
 		}
 		if (!priv->horiz_scroll_twofinger_on &&
 		    (para->scroll_twofinger_horiz) && (para->scroll_dist_horiz != 0)) {
+		    stop_coasting(priv);
 		    priv->horiz_scroll_twofinger_on = TRUE;
 		    priv->horiz_scroll_edge_on = FALSE;
 		    priv->scroll.last_x = hw->x;

commit d90003383cbec75da88bf1a88b886b1131597f3f
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Mon Apr 16 16:47:38 2012 +1000

    synaptics 1.5.99.903
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/configure.ac b/configure.ac
index 0a85d13..de136f2 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.902],
+        [1.5.99.903],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-input-synaptics])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 1874094f0e99d8db319f6cf769ce5a25c9bc490c
Author: Alyssa Hung <ahung@isisview.org>
Date:   Fri Apr 13 01:04:38 2012 -0400

    Support inverted scroll direction.
    
    This patch allows scroll direction to be inverted by allowing
    VertScrollDelta and HorizScrollDelta to be set to negative values. This
    enables behaviour that is consistent with modern touchscreen devices,
    where the content scrolls in the same direction as the user's finger
    movement.
    
    Signed-off-by: Alyssa Hung <ahung@isisview.org>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/man/synaptics.man b/man/synaptics.man
index 864a95f..2cbe50e 100644
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -634,6 +634,9 @@ 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.
+.
 .LP
 Acceleration is mostly handled outside the driver, thus the driver will
 translate MinSpeed into constant deceleration and adapt MaxSpeed at
diff --git a/src/synaptics.c b/src/synaptics.c
index fd6eb73..40478ec 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2558,14 +2558,14 @@ HandleScrolling(SynapticsPrivate *priv, struct SynapticsHwState *hw,
 
     if (priv->vert_scroll_edge_on || priv->vert_scroll_twofinger_on) {
 	/* + = down, - = up */
-	if (para->scroll_dist_vert > 0 && hw->y != priv->scroll.last_y) {
+	if (para->scroll_dist_vert != 0 && hw->y != priv->scroll.last_y) {
 	    priv->scroll.delta_y += (hw->y - priv->scroll.last_y);
 	    priv->scroll.last_y = hw->y;
 	}
     }
     if (priv->horiz_scroll_edge_on || priv->horiz_scroll_twofinger_on) {
 	/* + = right, - = left */
-	if (para->scroll_dist_horiz > 0 && hw->x != priv->scroll.last_x) {
+	if (para->scroll_dist_horiz != 0 && hw->x != priv->scroll.last_x) {
 	    priv->scroll.delta_x += (hw->x - priv->scroll.last_x);
 	    priv->scroll.last_x = hw->x;
 	}
diff --git a/tools/synclient.c b/tools/synclient.c
index aef719f..6c8ee7a 100644
--- a/tools/synclient.c
+++ b/tools/synclient.c
@@ -90,8 +90,8 @@ static struct Parameter params[] = {
     {"EmulateMidButtonTime",  PT_INT,    0, 1000,  SYNAPTICS_PROP_MIDDLE_TIMEOUT,32,	0},
     {"EmulateTwoFingerMinZ",  PT_INT,    0, 1000,  SYNAPTICS_PROP_TWOFINGER_PRESSURE,	32,	0},
     {"EmulateTwoFingerMinW",  PT_INT,    0, 15,    SYNAPTICS_PROP_TWOFINGER_WIDTH,	32,	0},
-    {"VertScrollDelta",       PT_INT,    0, 1000,  SYNAPTICS_PROP_SCROLL_DISTANCE,	32,	0},
-    {"HorizScrollDelta",      PT_INT,    0, 1000,  SYNAPTICS_PROP_SCROLL_DISTANCE,	32,	1},
+    {"VertScrollDelta",       PT_INT,    -1000, 1000,  SYNAPTICS_PROP_SCROLL_DISTANCE,	32,	0},
+    {"HorizScrollDelta",      PT_INT,    -1000, 1000,  SYNAPTICS_PROP_SCROLL_DISTANCE,	32,	1},
     {"VertEdgeScroll",        PT_BOOL,   0, 1,     SYNAPTICS_PROP_SCROLL_EDGE,	8,	0},
     {"HorizEdgeScroll",       PT_BOOL,   0, 1,     SYNAPTICS_PROP_SCROLL_EDGE,	8,	1},
     {"CornerCoasting",        PT_BOOL,   0, 1,     SYNAPTICS_PROP_SCROLL_EDGE,	8,	2},

commit 38b93b71c812c6d7b7085f40d049b0a4927e52dd
Author: Chase Douglas <chase.douglas@canonical.com>
Date:   Mon Apr 2 11:23:05 2012 -0700

    Use maximum number of touches reported by evdev
    
    This resolves a regression from da461b91659d0c64aa6827e065aee2682116a57e
    where three touch tap and click actions on certain devices no longer
    work.
    
    Some devices report a higher touch count than the number of touches they
    can provide data for. For example, many Synaptics touchpads can report
    up to five touches, but only provide data for two of them. We need to be
    able to report the correct number of touches for these devices when
    there are three touches. Using the maximum of the reported touch count
    and the number of touches provided ensures the count is accurate for all
    device types.
    
    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/eventcomm.c b/src/eventcomm.c
index 361f878..9d1233c 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -627,11 +627,6 @@ static int count_fingers(InputInfoPtr pInfo, const struct CommData *comm)
     struct eventcomm_proto_data *proto_data = priv->proto_data;
     int fingers = 0;
 
-#ifdef HAVE_MULTITOUCH
-    if (priv->has_touch)
-        return proto_data->num_touches;
-#endif
-
     if (comm->oneFinger)
 	fingers = 1;
     else if (comm->twoFingers)
@@ -639,6 +634,11 @@ static int count_fingers(InputInfoPtr pInfo, const struct CommData *comm)
     else if (comm->threeFingers)
 	fingers = 3;
 
+#ifdef HAVE_MULTITOUCH
+    if (priv->has_touch && proto_data->num_touches > fingers)
+        fingers = proto_data->num_touches;
+#endif
+
     return fingers;
 }
 

commit 5a1612d4496b51682c9043aa064025c545249de6
Author: Pierre Lulé <pierre@lule.fr>
Date:   Wed Mar 28 00:13:30 2012 +0200

    Fix coasting speed
    
    Fixes a bug introduced in commit 2603ad69b997c999404ecc441e0d64ea2cc22018
    (Use the scroll distances as increment for scrolling valuator axes)
    
    Since this commit, scroll distance was set with SetScrollValuator function
    but it was still used as a divisor to calculate coasting,
    thus making coasting too slow. (at least on my computer)
    
    Deleting the divisor fixes the issue.
    
    A report of the same bug : https://bugs.archlinux.org/task/28955
    
    Signed-off-by: Pierre Lulé <pierre@lule.fr>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/synaptics.c b/src/synaptics.c
index 3681b41..fd6eb73 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2330,39 +2330,36 @@ start_coasting(SynapticsPrivate *priv, struct SynapticsHwState *hw,
 	double pkt_time = HIST_DELTA(0, 3, millis) / 1000.0;
 	if (vert && !circ) {
 	    double dy = estimate_delta(HIST(0).y, HIST(1).y, HIST(2).y, HIST(3).y);
-	    int sdelta = para->scroll_dist_vert;
-	    if (pkt_time > 0 && sdelta > 0) {
-		double scrolls_per_sec = dy / pkt_time / sdelta;
+	    if (pkt_time > 0) {
+		double scrolls_per_sec = dy / pkt_time;
 		if (fabs(scrolls_per_sec) >= para->coasting_speed) {
 		    priv->scroll.coast_speed_y = scrolls_per_sec;
-		    priv->scroll.coast_delta_y = (hw->y - priv->scroll.last_y) / (double)sdelta;
+		    priv->scroll.coast_delta_y = (hw->y - priv->scroll.last_y);
 		}
 	    }
 	}
 	if (horiz && !circ){
 	    double dx = estimate_delta(HIST(0).x, HIST(1).x, HIST(2).x, HIST(3).x);
-	    int sdelta = para->scroll_dist_horiz;
-	    if (pkt_time > 0 && sdelta > 0) {
-		double scrolls_per_sec = dx / pkt_time / sdelta;
+	    if (pkt_time > 0) {
+		double scrolls_per_sec = dx / pkt_time;
 		if (fabs(scrolls_per_sec) >= para->coasting_speed) {
 		    priv->scroll.coast_speed_x = scrolls_per_sec;
-		    priv->scroll.coast_delta_x = (hw->x - priv->scroll.last_x) / (double)sdelta;
+		    priv->scroll.coast_delta_x = (hw->x - priv->scroll.last_x);
 		}
 	    }
 	}
 	if (circ) {
 	    double da = estimate_delta_circ(priv);
-	    double sdelta = para->scroll_dist_circ;
-	    if (pkt_time > 0 && sdelta > 0) {
-	        double scrolls_per_sec = da / pkt_time / sdelta;
+	    if (pkt_time > 0) {
+	        double scrolls_per_sec = da / pkt_time;
 	        if (fabs(scrolls_per_sec) >= para->coasting_speed) {
 	            if (vert) {
 	                priv->scroll.coast_speed_y = scrolls_per_sec;
-	                priv->scroll.coast_delta_y = diffa(priv->scroll.last_a, angle(priv, hw->x, hw->y)) / sdelta;
+	                priv->scroll.coast_delta_y = diffa(priv->scroll.last_a, angle(priv, hw->x, hw->y));
 	            }
 	            else if (horiz) {
 	                priv->scroll.coast_speed_x = scrolls_per_sec;
-	                priv->scroll.coast_delta_x = diffa(priv->scroll.last_a, angle(priv, hw->x, hw->y)) / sdelta;
+	                priv->scroll.coast_delta_x = diffa(priv->scroll.last_a, angle(priv, hw->x, hw->y));
 	            }
 	        }
 	    }

commit f68ddd9be4202333a1c3ccf536966a96dc0bfde7
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Apr 10 13:06:49 2012 +1000

    Don't count fingers twice when guessing distance (#48316)
    
    A finger may be closer than the required distance to more than one finger.
    e.g. for fingers A, B, C, AB, AC and BC may trigger the check and count
    C twice -resulting in a 4 finger click.
    
    Avoid double-counting by marking those fingers already close enough to a
    previous finger to avoid overcounting.
    
    X.Org Bug 48316 <http://bugs.freedesktop.org/show_bug.cgi?id=48316>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>

diff --git a/src/synaptics.c b/src/synaptics.c
index 918dc6f..3681b41 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2624,7 +2624,10 @@ clickpad_guess_clickfingers(SynapticsPrivate *priv, struct SynapticsHwState *hw)
 {
     int nfingers = 0;
 #if HAVE_MULTITOUCH
+    char close_point[SYNAPTICS_MAX_TOUCHES] = {0}; /* 1 for each point close
+                                                      to another one */
     int i, j;
+
     for (i = 0; i < hw->num_mt_mask - 1; i++) {
         ValuatorMask *f1;
 
@@ -2655,14 +2658,18 @@ clickpad_guess_clickfingers(SynapticsPrivate *priv, struct SynapticsHwState *hw)
              * you'll need to find a touchpad that doesn't lie about it's
              * size. Good luck. */
             if (abs(x1 - x2) < (priv->maxx - priv->minx) * .3 &&
-                abs(y1 - y2) < (priv->maxy - priv->miny) * .3)
-                nfingers++;
+                abs(y1 - y2) < (priv->maxy - priv->miny) * .3) {
+                close_point[j] = 1;
+                close_point[i] = 1;
+            }
         }
     }
+
+    for (i = 0; i < SYNAPTICS_MAX_TOUCHES; i++)
+        nfingers += close_point[i];
 #endif
 
-    /* 1 doesn't make sense */
-    return nfingers ? nfingers + 1 : 0;
+    return nfingers;
 }
 
 

commit c745604461541c7b21779c60c9bd09ff1a390df2
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Apr 11 10:15:07 2012 +1000

    tools: skip non-existing properties
    
    If a property doesn't exist on a device, skip it.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>

diff --git a/tools/synclient.c b/tools/synclient.c
index 942312a..aef719f 100644
--- a/tools/synclient.c
+++ b/tools/synclient.c
@@ -446,6 +446,13 @@ dp_set_variables(Display *dpy, XDevice* dev, int argc, char *argv[], int first_c
 	XGetDeviceProperty(dpy, dev, prop, 0, 1000, False, AnyPropertyType,
 				&type, &format, &nitems, &bytes_after, &data);
 
+	if (type == None)
+	{
+	    fprintf(stderr, "Property for '%s' not available. Skipping.\n",
+		    par->name);
+	    continue;
+	}
+
 	switch(par->prop_format)
 	{
 	    case 8:
@@ -517,6 +524,8 @@ dp_show_settings(Display *dpy, XDevice *dev)
 	XGetDeviceProperty(dpy, dev, a, 0, len, False,
 				AnyPropertyType, &type, &format,
 				&nitems, &bytes_after, &data);
+	if (type == None)
+	    continue;
 
 	switch(par->prop_format) {
 	    case 8:

commit 8e297cb586ab855dc7c018c6f3f2f42c08db0419
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Apr 10 13:03:35 2012 +1000

    Replace hardcoded max number of touches with a define.
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>

diff --git a/src/synaptics.c b/src/synaptics.c
index 99b5085..918dc6f 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1186,7 +1186,7 @@ DeviceInitTouch(DeviceIntPtr dev, Atom *axes_labels)
 
     if (priv->has_touch)
     {
-        priv->num_slots = priv->max_touches ? priv->max_touches : 10;
+        priv->num_slots = priv->max_touches ? priv->max_touches : SYNAPTICS_MAX_TOUCHES;
 
         priv->open_slots = malloc(priv->num_slots * sizeof(int));
         if (!priv->open_slots)
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index 55aab3d..14ae362 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -49,6 +49,7 @@
  *					structs, typedefs, #defines, enums
  *****************************************************************************/
 #define SYNAPTICS_MOVE_HISTORY	5
+#define SYNAPTICS_MAX_TOUCHES	10
 
 typedef struct _SynapticsMoveHist
 {

commit 3f9794a8a0f019a4b153941c9ec1927c7797ce6f
Author: Chase Douglas <chase.douglas@canonical.com>
Date:   Mon Apr 9 11:38:16 2012 -0700

    Check touch record bounds before access
    
    We guess ten simultaneous touches if the device does not tell us. The
    Linux drivers for the Apple multitouch trackpads do not tell the number
    of simultaneous touches, but they can do more than ten. When this
    occurs, the array index into the touch records will be invalid. We must
    not process the touch or else we will segfault.
    
    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/eventcomm.c b/src/eventcomm.c
index 28d034f..361f878 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -564,6 +564,9 @@ EventProcessTouchEvent(InputInfoPtr pInfo, struct SynapticsHwState *hw,
     {
         int slot_index = last_mt_vals_slot(priv);
 
+        if (slot_index < 0)
+            return;
+
         if (hw->slot_state[slot_index] == SLOTSTATE_EMPTY ||
             hw->slot_state[slot_index] == SLOTSTATE_OPEN_EMPTY)
             hw->slot_state[slot_index] = SLOTSTATE_UPDATE;

commit 4c87455f3ecd1b82a3612a3050e463a0efb90f0c
Author: Chase Douglas <chase.douglas@canonical.com>
Date:   Fri Mar 23 10:51:59 2012 -0700

    Do not perform a tap action when more than three touches
    
    Though this looks like a behavior change, it really isn't since the
    maximum tap_max_fingers that was previously possible was already handled.
    The only real change is that if a tap is recognized but the
    tap_max_fingers is zero, a tap will no longer be emitted. This shouldn't
    happen in the real world.
    
    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/synaptics.c b/src/synaptics.c
index f07fd13..99b5085 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1798,7 +1798,6 @@ SelectTapButton(SynapticsPrivate *priv, edge_type edge)
 
     switch (priv->tap_max_fingers) {
     case 1:
-    default:
 	switch (edge) {
 	case RIGHT_TOP_EDGE:
 	    DBG(7, "right top edge\n");
@@ -1830,6 +1829,9 @@ SelectTapButton(SynapticsPrivate *priv, edge_type edge)
 	DBG(7, "three finger tap\n");
 	tap = F3_TAP;
 	break;
+    default:
+        priv->tap_button = 0;
+        return;
     }
 
     priv->tap_button = priv->synpara.tap_action[tap];

commit da461b91659d0c64aa6827e065aee2682116a57e
Author: Chase Douglas <chase.douglas@canonical.com>
Date:   Fri Mar 23 10:51:58 2012 -0700

    Count number of multitouch touches for multitouch finger count
    
    The evdev protocol only goes up to three touches for non-multitouch
    devices. If you perform a four touch tap, the finger count will only go
    up to three touches if you roll your fingers, or will always be 0 if all
    four touches land at the same time.
    
    This change ensures the correct finger count is reported.
    
    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/eventcomm.c b/src/eventcomm.c
index cd89180..28d034f 100644


Reply to: