synaptics - double taps are ignored in some applications

Gabriele Mazzotta gabriele.mzt at gmail.com
Tue Jan 13 11:47:32 PST 2015


I tried different things and came up with the following patch. I added
an additional state, but I could get reliable taps even without it.
However the intervals between consequent clicks when tapping continuosly
were not constant without it, so I preffered to include it.

Now there should be no differences between double, triple etc... taps.
As long as taps are performed, two states (TS_2B and TS_2C) are used
until the timeout expires.

I hardcoded the timeout because it basically determines how distant
a button release and the next button press are and with the previous
default value (180ms), clicks where too distant in time, enough for
applications to consider them as separate clicks.
Should I make it adjustable? In this case, I'd surely use a different
name for the prop to prevent issues with existing configurations.

I think that in case of three taps, the third tap is sent a bit late,
but I haven't seen major issues with it.


Here the diff (I kept some dead code). Any comment?

diff --git a/src/synaptics.c b/src/synaptics.c
index e6a90f2..934cc80 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1928,6 +1928,9 @@ SetTapState(SynapticsPrivate * priv, enum TapState tap_state, CARD32 millis)
     case TS_2B:
         priv->tap_button_state = TBS_BUTTON_UP;
         break;
+    case TS_2C:
+        priv->tap_button_state = TBS_BUTTON_DOWN;
+        break;
     case TS_3:
         priv->tap_button_state = TBS_BUTTON_DOWN;
         break;
@@ -1967,7 +1970,8 @@ GetTimeOut(SynapticsPrivate * priv)
     case TS_2A:
         return para->single_tap_timeout;
     case TS_2B:
-        return para->tap_time_2;
+    case TS_2C:
+        return 50;
     case TS_4:
         return para->locked_drag_time;
     default:
@@ -2066,13 +2070,16 @@ HandleTapProcessing(SynapticsPrivate * priv, struct SynapticsHwState *hw,
             SetTapState(priv, TS_SINGLETAP, now);
         break;
     case TS_2B:
-        if (touch) {
-            SetTapState(priv, TS_3, now);
-        }
-        else if (is_timeout) {
+        if (touch)
+            SetTapState(priv, TS_2C, now);
+        else if (is_timeout)
+            SetTapState(priv, TS_SINGLETAP, now);
+        break;
+    case TS_2C:
+        if (release)
+            SetTapState(priv, TS_2B, now);
+        else if (is_timeout)
             SetTapState(priv, TS_START, now);
-            priv->tap_button_state = TBS_BUTTON_DOWN_UP;
-        }
         break;
     case TS_SINGLETAP:
         if (touch)
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index a17e39b..6fc2105 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -126,6 +126,7 @@ enum TapState {
     TS_MOVE,                    /* Pointer movement enabled */
     TS_2A,                      /* After first release */
     TS_2B,                      /* After second/third/... release */
+    TS_2C,                      /* After second/third/... press */
     TS_SINGLETAP,               /* After timeout after first release */
     TS_3,                       /* After second touch */
     TS_DRAG,                    /* Pointer drag enabled */


More information about the xorg-devel mailing list