Here's the correct update to the 1.6.2 bugfix release. Tested with an ALPS glidepoint and the fix I've just send to bugs@.
Ok? Martin Index: aclocal.m4 =================================================================== RCS file: /cvs/xenocara/driver/xf86-input-synaptics/aclocal.m4,v retrieving revision 1.3 diff -u -p -r1.3 aclocal.m4 --- aclocal.m4 1 Apr 2012 12:18:44 -0000 1.3 +++ aclocal.m4 29 Jun 2012 10:03:04 -0000 @@ -11205,7 +11205,6 @@ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS] XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute]) -XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) # These are currently disabled because they are noisy. They will be enabled # in the future once the codebase is sufficiently modernized to silence Index: configure =================================================================== RCS file: /cvs/xenocara/driver/xf86-input-synaptics/configure,v retrieving revision 1.5 diff -u -p -r1.5 configure --- configure 12 Jun 2012 18:59:42 -0000 1.5 +++ configure 29 Jun 2012 10:03:04 -0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.62 for xf86-input-synaptics 1.6.1. +# Generated by GNU Autoconf 2.62 for xf86-input-synaptics 1.6.2. # # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. # @@ -616,8 +616,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='xf86-input-synaptics' PACKAGE_TARNAME='xf86-input-synaptics' -PACKAGE_VERSION='1.6.1' -PACKAGE_STRING='xf86-input-synaptics 1.6.1' +PACKAGE_VERSION='1.6.2' +PACKAGE_STRING='xf86-input-synaptics 1.6.2' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' ac_unique_file="Makefile.am" @@ -1409,7 +1409,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xf86-input-synaptics 1.6.1 to adapt to many kinds of systems. +\`configure' configures xf86-input-synaptics 1.6.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1480,7 +1480,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xf86-input-synaptics 1.6.1:";; + short | recursive ) echo "Configuration of xf86-input-synaptics 1.6.2:";; esac cat <<\_ACEOF @@ -1612,7 +1612,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xf86-input-synaptics configure 1.6.1 +xf86-input-synaptics configure 1.6.2 generated by GNU Autoconf 2.62 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1626,7 +1626,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xf86-input-synaptics $as_me 1.6.1, which was +It was created by xf86-input-synaptics $as_me 1.6.2, which was generated by GNU Autoconf 2.62. Invocation command line was $ $0 $@ @@ -2280,7 +2280,7 @@ fi # Define the identity of the package. PACKAGE='xf86-input-synaptics' - VERSION='1.6.1' + VERSION='1.6.2' cat >>confdefs.h <<_ACEOF @@ -15773,203 +15773,6 @@ $as_echo "$supported" >&6; } - - - - - - - - - - - - -xorg_testset_save_CFLAGS="$CFLAGS" - -if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then - CFLAGS="$CFLAGS -Werror=unknown-warning-option" - { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unknown-warning-option" >&5 -$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } -if test "${xorg_cv_cc_flag_unknown_warning_option+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int i; -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - xorg_cv_cc_flag_unknown_warning_option=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - xorg_cv_cc_flag_unknown_warning_option=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 -$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } - xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option - CFLAGS="$xorg_testset_save_CFLAGS" -fi - -if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then - if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then - CFLAGS="$CFLAGS -Werror=unknown-warning-option" - fi - CFLAGS="$CFLAGS -Werror=unused-command-line-argument" - { $as_echo "$as_me:$LINENO: checking if $CC supports -Werror=unused-command-line-argument" >&5 -$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } -if test "${xorg_cv_cc_flag_unused_command_line_argument+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int i; -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - xorg_cv_cc_flag_unused_command_line_argument=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - xorg_cv_cc_flag_unused_command_line_argument=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 -$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } - xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument - CFLAGS="$xorg_testset_save_CFLAGS" -fi - -found="no" - - if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then - CFLAGS="$CFLAGS -Werror=unknown-warning-option" - fi - - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then - CFLAGS="$CFLAGS -Werror=unused-command-line-argument" - fi - - CFLAGS="$CFLAGS -Wredundant-decls" - - { $as_echo "$as_me:$LINENO: checking if $CC supports-Wredundant-decls" >&5 -$as_echo_n "checking if $CC supports-Wredundant-decls... " >&6; } - cacheid=xorg_cv_cc_flag__Wredundant_decls - if { as_var=$cacheid; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int i; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval $cacheid=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval $cacheid=no -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi - - - CFLAGS="$xorg_testset_save_CFLAGS" - - eval supported=\$$cacheid - { $as_echo "$as_me:$LINENO: result: $supported" >&5 -$as_echo "$supported" >&6; } - if test "$supported" = "yes" ; then - BASE_CFLAGS="$BASE_CFLAGS -Wredundant-decls" - found="yes" - fi - fi - - - # These are currently disabled because they are noisy. They will be enabled # in the future once the codebase is sufficiently modernized to silence # them. For now, I don't want them to drown out the other warnings. @@ -23695,7 +23498,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xf86-input-synaptics $as_me 1.6.1, which was +This file was extended by xf86-input-synaptics $as_me 1.6.2, which was generated by GNU Autoconf 2.62. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -23748,7 +23551,7 @@ Report bugs to <bug-autoc...@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -xf86-input-synaptics config.status 1.6.1 +xf86-input-synaptics config.status 1.6.2 configured by $0, generated by GNU Autoconf 2.62, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Index: configure.ac =================================================================== RCS file: /cvs/xenocara/driver/xf86-input-synaptics/configure.ac,v retrieving revision 1.5 diff -u -p -r1.5 configure.ac --- configure.ac 12 Jun 2012 18:59:42 -0000 1.5 +++ configure.ac 29 Jun 2012 10:03:04 -0000 @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) AC_INIT([xf86-input-synaptics], - [1.6.1], + [1.6.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xf86-input-synaptics]) AC_CONFIG_SRCDIR([Makefile.am]) Index: src/eventcomm.c =================================================================== RCS file: /cvs/xenocara/driver/xf86-input-synaptics/src/eventcomm.c,v retrieving revision 1.5 diff -u -p -r1.5 eventcomm.c --- src/eventcomm.c 12 Jun 2012 18:59:42 -0000 1.5 +++ src/eventcomm.c 29 Jun 2012 09:39:36 -0000 @@ -564,8 +564,7 @@ EventProcessTouchEvent(InputInfoPtr pInf if (slot_index < 0) return; - if (hw->slot_state[slot_index] == SLOTSTATE_EMPTY || - hw->slot_state[slot_index] == SLOTSTATE_OPEN_EMPTY) + if (hw->slot_state[slot_index] == SLOTSTATE_OPEN_EMPTY) hw->slot_state[slot_index] = SLOTSTATE_UPDATE; if (ev->code == ABS_MT_TRACKING_ID) { if (ev->value >= 0) { @@ -580,7 +579,7 @@ EventProcessTouchEvent(InputInfoPtr pInf "Attempted to copy values from out-of-range " "slot, touch events may be incorrect.\n"); } - else { + else if (hw->slot_state[slot_index] != SLOTSTATE_EMPTY) { hw->slot_state[slot_index] = SLOTSTATE_CLOSE; proto_data->num_touches--; } Index: src/properties.c =================================================================== RCS file: /cvs/xenocara/driver/xf86-input-synaptics/src/properties.c,v retrieving revision 1.4 diff -u -p -r1.4 properties.c --- src/properties.c 12 Jun 2012 18:59:42 -0000 1.4 +++ src/properties.c 29 Jun 2012 09:39:36 -0000 @@ -519,6 +519,9 @@ SetProperty(DeviceIntPtr dev, Atom prope 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 prope return BadMatch; circdist = *(float *) prop->data; + if (circdist == 0) + return BadValue; + para->scroll_dist_circ = circdist; } else if (property == prop_circscroll_trigger) { Index: src/synaptics.c =================================================================== RCS file: /cvs/xenocara/driver/xf86-input-synaptics/src/synaptics.c,v retrieving revision 1.5 diff -u -p -r1.5 synaptics.c --- src/synaptics.c 12 Jun 2012 18:59:42 -0000 1.5 +++ src/synaptics.c 29 Jun 2012 10:12:59 -0000 @@ -1156,6 +1156,9 @@ SynapticsReset(SynapticsPrivate * priv) priv->lastButtons = 0; priv->prev_z = 0; priv->prevFingers = 0; +#ifdef HAVE_MULTITOUCH + memset(priv->open_slots, 0, priv->num_slots * sizeof(int)); +#endif } static Bool @@ -2743,7 +2746,7 @@ HandleScrolling(SynapticsPrivate * priv, double dtime = (hw->millis - priv->scroll.last_millis) / 1000.0; double ddy = para->coasting_friction * dtime; - priv->scroll.delta_y += priv->scroll.coast_speed_y * dtime * para->scroll_dist_vert; + priv->scroll.delta_y += priv->scroll.coast_speed_y * dtime * abs(para->scroll_dist_vert); delay = MIN(delay, POLL_MS); if (abs(priv->scroll.coast_speed_y) < ddy) { priv->scroll.coast_speed_y = 0; @@ -2758,7 +2761,7 @@ HandleScrolling(SynapticsPrivate * priv, if (priv->scroll.coast_speed_x) { double dtime = (hw->millis - priv->scroll.last_millis) / 1000.0; double ddx = para->coasting_friction * dtime; - priv->scroll.delta_x += priv->scroll.coast_speed_x * dtime * para->scroll_dist_vert; + priv->scroll.delta_x += priv->scroll.coast_speed_x * dtime * abs(para->scroll_dist_horiz); delay = MIN(delay, POLL_MS); if (abs(priv->scroll.coast_speed_x) < ddx) { priv->scroll.coast_speed_x = 0; @@ -3131,7 +3134,9 @@ UpdateTouchState(InputInfoPtr pInfo, str priv->open_slots[j] = priv->open_slots[j + 1]; } - priv->num_active_touches--; + BUG_WARN(priv->num_active_touches == 0); + if (priv->num_active_touches > 0) + priv->num_active_touches--; } } @@ -3274,6 +3279,19 @@ HandleState(InputInfoPtr pInfo, struct S if (para->touchpad_off == 1) { UpdateTouchState(pInfo, hw); 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; + } } /* If a physical button is pressed on a clickpad, use cumulative relative Index: src/synproto.c =================================================================== RCS file: /cvs/xenocara/driver/xf86-input-synaptics/src/synproto.c,v retrieving revision 1.1 diff -u -p -r1.1 synproto.c --- src/synproto.c 12 Jun 2012 18:59:42 -0000 1.1 +++ src/synproto.c 29 Jun 2012 09:39:36 -0000 @@ -134,8 +134,8 @@ void SynapticsResetHwState(struct SynapticsHwState *hw) { hw->millis = 0; - hw->x = 0; - hw->y = 0; + hw->x = INT_MIN; + hw->y = INT_MIN; hw->z = 0; hw->cumulative_dx = 0; hw->cumulative_dy = 0;