summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriele Mazzotta <gabriele.mzt@gmail.com>2015-01-15 22:04:17 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2015-02-18 16:52:56 +1000
commit37d34f0356cc556dd8a49ec5d1ed64d49417a9b2 (patch)
treedcc3b50010d42091fb54c0de9ef1223efef4d476 /src
parent064445364b4775b25ba49c2250b22b169f291147 (diff)
Add a delay between the second button down-up event of double taps
Some applications ignore the second tap of double taps because of the lack of a delay between the button down and button up events. Prevent this by replacing the transition from TS_2B to TS_START with a transition from TS_2B to TS_SINGLETAP that emits only a button down event. The button up event will be emitted when transitioning from TS_SINGLETAP to TS_START. In addition, decrease the default value of MaxDoubleTapTime from 180 ms to 100 ms in order to make double taps faster. Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r--src/synaptics.c27
-rw-r--r--src/synapticsstr.h1
2 files changed, 6 insertions, 22 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index 0f0b5b9..07b012f 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -671,7 +671,7 @@ set_default_parameters(InputInfoPtr pInfo)
pars->finger_high = xf86SetIntOption(opts, "FingerHigh", fingerHigh);
pars->tap_time = xf86SetIntOption(opts, "MaxTapTime", 180);
pars->tap_move = xf86SetIntOption(opts, "MaxTapMove", tapMove);
- pars->tap_time_2 = xf86SetIntOption(opts, "MaxDoubleTapTime", 180);
+ pars->tap_time_2 = xf86SetIntOption(opts, "MaxDoubleTapTime", 100);
pars->click_time = xf86SetIntOption(opts, "ClickTime", 100);
pars->clickpad = xf86SetBoolOption(opts, "ClickPad", pars->clickpad); /* Probed */
if (pars->clickpad)
@@ -2073,13 +2073,10 @@ HandleTapProcessing(SynapticsPrivate * priv, struct SynapticsHwState *hw,
SetTapState(priv, TS_SINGLETAP, now);
break;
case TS_2B:
- if (touch) {
+ if (touch)
SetTapState(priv, TS_3, now);
- }
- else if (is_timeout) {
- SetTapState(priv, TS_START, now);
- priv->tap_button_state = TBS_BUTTON_DOWN_UP;
- }
+ else if (is_timeout)
+ SetTapState(priv, TS_SINGLETAP, now);
break;
case TS_SINGLETAP:
if (touch)
@@ -3286,20 +3283,8 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now,
(hw->down ? 0x10 : 0) |
(hw->multi[2] ? 0x20 : 0) | (hw->multi[3] ? 0x40 : 0));
- if (priv->tap_button > 0) {
- int tap_mask = 1 << (priv->tap_button - 1);
-
- if (priv->tap_button_state == TBS_BUTTON_DOWN_UP) {
- if (tap_mask != (priv->lastButtons & tap_mask)) {
- xf86PostButtonEvent(pInfo->dev, FALSE, priv->tap_button, TRUE,
- 0, 0);
- priv->lastButtons |= tap_mask;
- }
- priv->tap_button_state = TBS_BUTTON_UP;
- }
- if (priv->tap_button_state == TBS_BUTTON_DOWN)
- buttons |= tap_mask;
- }
+ if (priv->tap_button > 0 && priv->tap_button_state == TBS_BUTTON_DOWN)
+ buttons |= 1 << (priv->tap_button - 1);
/* Post events */
if (finger >= FS_TOUCHED && (dx || dy) && !ignore_motion)
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index 0bc276d..91c41fc 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -137,7 +137,6 @@ enum TapState {
enum TapButtonState {
TBS_BUTTON_UP, /* "Virtual tap button" is up */
TBS_BUTTON_DOWN, /* "Virtual tap button" is down */
- TBS_BUTTON_DOWN_UP /* Send button down event + set up state */
};
enum TouchpadModel {