Commit 90c6d7fc authored by Gabriele Mazzotta's avatar Gabriele Mazzotta Committed by Peter Hutterer

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: default avatarGabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 37d34f03)
parent 649b77f0
......@@ -458,7 +458,7 @@
</dia:attribute>
<dia:connections>
<dia:connection handle="0" to="O1" connection="6"/>
<dia:connection handle="1" to="O35" connection="1"/>
<dia:connection handle="1" to="O34" connection="1"/>
</dia:connections>
</dia:object>
<dia:object type="Standard - Line" version="0" id="O8">
......@@ -577,37 +577,6 @@
</dia:connections>
</dia:object>
<dia:object type="Standard - BezierLine" version="0" id="O12">
<dia:attribute name="obj_pos">
<dia:point val="4.29223,19.8814"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="0.617308,7.22332;10.3763,19.9508"/>
</dia:attribute>
<dia:attribute name="bez_points">
<dia:point val="4.29223,19.8814"/>
<dia:point val="-3.17884,14.883"/>
<dia:point val="1.95138,8.18572"/>
<dia:point val="10.3763,7.64119"/>
</dia:attribute>
<dia:attribute name="corner_types">
<dia:enum val="0"/>
<dia:enum val="0"/>
</dia:attribute>
<dia:attribute name="end_arrow">
<dia:enum val="1"/>
</dia:attribute>
<dia:attribute name="end_arrow_length">
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:attribute name="end_arrow_width">
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:connections>
<dia:connection handle="0" to="O2" connection="0"/>
<dia:connection handle="3" to="O0" connection="3"/>
</dia:connections>
</dia:object>
<dia:object type="Standard - BezierLine" version="0" id="O13">
<dia:attribute name="obj_pos">
<dia:point val="10.3763,27.743"/>
</dia:attribute>
......@@ -638,7 +607,7 @@
<dia:connection handle="3" to="O2" connection="5"/>
</dia:connections>
</dia:object>
<dia:object type="UML - Note" version="0" id="O14">
<dia:object type="UML - Note" version="0" id="O13">
<dia:attribute name="obj_pos">
<dia:point val="1.84118,30.7912"/>
</dia:attribute>
......@@ -700,7 +669,7 @@ TDG: Tap-and-drag gesture enabled#</dia:string>
</dia:composite>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O15">
<dia:object type="Standard - Text" version="1" id="O14">
<dia:attribute name="obj_pos">
<dia:point val="11.23,10.8357"/>
</dia:attribute>
......@@ -733,7 +702,7 @@ TDG: Tap-and-drag gesture enabled#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O16">
<dia:object type="Standard - Text" version="1" id="O15">
<dia:attribute name="obj_pos">
<dia:point val="8.4912,23.1912"/>
</dia:attribute>
......@@ -767,7 +736,7 @@ TDG: Tap-and-drag gesture enabled#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O17">
<dia:object type="Standard - Text" version="1" id="O16">
<dia:attribute name="obj_pos">
<dia:point val="17.0662,11.0357"/>
</dia:attribute>
......@@ -800,7 +769,7 @@ TDG: Tap-and-drag gesture enabled#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Line" version="0" id="O18">
<dia:object type="Standard - Line" version="0" id="O17">
<dia:attribute name="obj_pos">
<dia:point val="13.6263,27.743"/>
</dia:attribute>
......@@ -828,7 +797,7 @@ TDG: Tap-and-drag gesture enabled#</dia:string>
<dia:connection handle="1" to="O5" connection="3"/>
</dia:connections>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O19">
<dia:object type="Standard - Text" version="1" id="O18">
<dia:attribute name="obj_pos">
<dia:point val="12.9069,17.2258"/>
</dia:attribute>
......@@ -861,7 +830,7 @@ TDG: Tap-and-drag gesture enabled#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O20">
<dia:object type="Standard - Text" version="1" id="O19">
<dia:attribute name="obj_pos">
<dia:point val="5.32686,26.1857"/>
</dia:attribute>
......@@ -895,7 +864,7 @@ TDG: Tap-and-drag gesture enabled#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O21">
<dia:object type="Standard - Text" version="1" id="O20">
<dia:attribute name="obj_pos">
<dia:point val="16.3912,13.6912"/>
</dia:attribute>
......@@ -928,7 +897,7 @@ TDG: Tap-and-drag gesture enabled#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O22">
<dia:object type="Standard - Text" version="1" id="O21">
<dia:attribute name="obj_pos">
<dia:point val="16.1,28.5375"/>
</dia:attribute>
......@@ -962,18 +931,18 @@ and TDG#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O23">
<dia:object type="Standard - Text" version="1" id="O22">
<dia:attribute name="obj_pos">
<dia:point val="1.24118,9.9412"/>
<dia:point val="4.54118,17.5412"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="0.27868,9.4087;2.20368,10.9337"/>
<dia:rectangle val="3.96368,17.0087;5.11868,18.5337"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
<dia:attribute name="string">
<dia:string>#TO3
[D,U]#</dia:string>
[D]#</dia:string>
</dia:attribute>
<dia:attribute name="font">
<dia:font family="courier new" style="0" name="Courier"/>
......@@ -982,7 +951,7 @@ and TDG#</dia:string>
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:attribute name="pos">
<dia:point val="1.24118,9.9412"/>
<dia:point val="4.54118,17.5412"/>
</dia:attribute>
<dia:attribute name="color">
<dia:color val="#000000"/>
......@@ -996,7 +965,7 @@ and TDG#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O24">
<dia:object type="Standard - Text" version="1" id="O23">
<dia:attribute name="obj_pos">
<dia:point val="24.4912,17.8412"/>
</dia:attribute>
......@@ -1030,7 +999,7 @@ and TDG#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="UML - Usecase" version="0" id="O25">
<dia:object type="UML - Usecase" version="0" id="O24">
<dia:attribute name="obj_pos">
<dia:point val="19.7687,32.4912"/>
</dia:attribute>
......@@ -1087,7 +1056,7 @@ and TDG#</dia:string>
</dia:composite>
</dia:attribute>
</dia:object>
<dia:object type="UML - Usecase" version="0" id="O26">
<dia:object type="UML - Usecase" version="0" id="O25">
<dia:attribute name="obj_pos">
<dia:point val="19.7687,38.0412"/>
</dia:attribute>
......@@ -1144,7 +1113,7 @@ and TDG#</dia:string>
</dia:composite>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Line" version="0" id="O27">
<dia:object type="Standard - Line" version="0" id="O26">
<dia:attribute name="obj_pos">
<dia:point val="21.3937,28.743"/>
</dia:attribute>
......@@ -1169,10 +1138,10 @@ and TDG#</dia:string>
</dia:attribute>
<dia:connections>
<dia:connection handle="0" to="O5" connection="6"/>
<dia:connection handle="1" to="O25" connection="1"/>
<dia:connection handle="1" to="O24" connection="1"/>
</dia:connections>
</dia:object>
<dia:object type="Standard - Line" version="0" id="O28">
<dia:object type="Standard - Line" version="0" id="O27">
<dia:attribute name="obj_pos">
<dia:point val="21.3937,34.4912"/>
</dia:attribute>
......@@ -1196,11 +1165,11 @@ and TDG#</dia:string>
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:connections>
<dia:connection handle="0" to="O25" connection="6"/>
<dia:connection handle="1" to="O26" connection="1"/>
<dia:connection handle="0" to="O24" connection="6"/>
<dia:connection handle="1" to="O25" connection="1"/>
</dia:connections>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O29">
<dia:object type="Standard - Text" version="1" id="O28">
<dia:attribute name="obj_pos">
<dia:point val="20.15,30.7875"/>
</dia:attribute>
......@@ -1233,7 +1202,7 @@ and TDG#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O30">
<dia:object type="Standard - Text" version="1" id="O29">
<dia:attribute name="obj_pos">
<dia:point val="20.7108,36.3412"/>
</dia:attribute>
......@@ -1266,7 +1235,7 @@ and TDG#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O31">
<dia:object type="Standard - Text" version="1" id="O30">
<dia:attribute name="obj_pos">
<dia:point val="16.7608,32.1912"/>
</dia:attribute>
......@@ -1301,7 +1270,7 @@ M#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="Standard - BezierLine" version="0" id="O32">
<dia:object type="Standard - BezierLine" version="0" id="O31">
<dia:attribute name="obj_pos">
<dia:point val="20.2447,38.3341"/>
</dia:attribute>
......@@ -1328,11 +1297,11 @@ M#</dia:string>
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:connections>
<dia:connection handle="0" to="O26" connection="0"/>
<dia:connection handle="0" to="O25" connection="0"/>
<dia:connection handle="3" to="O5" connection="5"/>
</dia:connections>
</dia:object>
<dia:object type="Standard - BezierLine" version="0" id="O33">
<dia:object type="Standard - BezierLine" version="0" id="O32">
<dia:attribute name="obj_pos">
<dia:point val="23.0187,39.0412"/>
</dia:attribute>
......@@ -1359,11 +1328,11 @@ M#</dia:string>
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:connections>
<dia:connection handle="0" to="O26" connection="4"/>
<dia:connection handle="0" to="O25" connection="4"/>
<dia:connection handle="3" to="O0" connection="1"/>
</dia:connections>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O34">
<dia:object type="Standard - Text" version="1" id="O33">
<dia:attribute name="obj_pos">
<dia:point val="31.1912,22.9412"/>
</dia:attribute>
......@@ -1397,7 +1366,7 @@ M#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="UML - Usecase" version="0" id="O35">
<dia:object type="UML - Usecase" version="0" id="O34">
<dia:attribute name="obj_pos">
<dia:point val="10.3763,19.6385"/>
</dia:attribute>
......@@ -1454,7 +1423,7 @@ M#</dia:string>
</dia:composite>
</dia:attribute>
</dia:object>
<dia:object type="UML - Usecase" version="0" id="O36">
<dia:object type="UML - Usecase" version="0" id="O35">
<dia:attribute name="obj_pos">
<dia:point val="3.36628,12.7652"/>
</dia:attribute>
......@@ -1512,12 +1481,12 @@ Tap#</dia:string>
</dia:composite>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O37">
<dia:object type="Standard - Text" version="1" id="O36">
<dia:attribute name="obj_pos">
<dia:point val="8.11628,16.7357"/>
<dia:point val="9.61628,16.9857"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="7.53878,16.1851;8.7119,17.7645"/>
<dia:rectangle val="9.03878,16.4532;10.1938,17.9782"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
......@@ -1532,7 +1501,7 @@ Tap#</dia:string>
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:attribute name="pos">
<dia:point val="8.11628,16.7357"/>
<dia:point val="9.61628,16.9857"/>
</dia:attribute>
<dia:attribute name="color">
<dia:color val="#000000"/>
......@@ -1546,7 +1515,7 @@ Tap#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Line" version="0" id="O38">
<dia:object type="Standard - Line" version="0" id="O37">
<dia:attribute name="obj_pos">
<dia:point val="12.0013,21.6385"/>
</dia:attribute>
......@@ -1570,11 +1539,11 @@ Tap#</dia:string>
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:connections>
<dia:connection handle="0" to="O35" connection="6"/>
<dia:connection handle="0" to="O34" connection="6"/>
<dia:connection handle="1" to="O3" connection="1"/>
</dia:connections>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O39">
<dia:object type="Standard - Text" version="1" id="O38">
<dia:attribute name="obj_pos">
<dia:point val="13.2364,23.2857"/>
</dia:attribute>
......@@ -1608,7 +1577,7 @@ Tap#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Line" version="0" id="O40">
<dia:object type="Standard - Line" version="0" id="O39">
<dia:attribute name="obj_pos">
<dia:point val="5.44128,12.7652"/>
</dia:attribute>
......@@ -1632,11 +1601,11 @@ Tap#</dia:string>
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:connections>
<dia:connection handle="0" to="O36" connection="1"/>
<dia:connection handle="0" to="O35" connection="1"/>
<dia:connection handle="1" to="O0" connection="5"/>
</dia:connections>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O41">
<dia:object type="Standard - Text" version="1" id="O40">
<dia:attribute name="obj_pos">
<dia:point val="7.37686,9.76072"/>
</dia:attribute>
......@@ -1670,7 +1639,7 @@ Tap#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Line" version="0" id="O42">
<dia:object type="Standard - Line" version="0" id="O41">
<dia:attribute name="obj_pos">
<dia:point val="7.51628,14.1485"/>
</dia:attribute>
......@@ -1694,11 +1663,11 @@ Tap#</dia:string>
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:connections>
<dia:connection handle="0" to="O36" connection="4"/>
<dia:connection handle="0" to="O35" connection="4"/>
<dia:connection handle="1" to="O1" connection="3"/>
</dia:connections>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O43">
<dia:object type="Standard - Text" version="1" id="O42">
<dia:attribute name="obj_pos">
<dia:point val="8.77686,12.9857"/>
</dia:attribute>
......@@ -1732,16 +1701,16 @@ Tap#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Arc" version="0" id="O44">
<dia:object type="Standard - Arc" version="0" id="O43">
<dia:attribute name="obj_pos">
<dia:point val="10.3763,20.6385"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="5.38433,15.4795;10.447,20.7092"/>
<dia:rectangle val="6.86308,15.0734;10.4452,20.7074"/>
</dia:attribute>
<dia:attribute name="conn_endpoints">
<dia:point val="10.3763,20.6385"/>
<dia:point val="5.45503,15.5502"/>
<dia:point val="6.932,15.1423"/>
</dia:attribute>
<dia:attribute name="curve_distance">
<dia:real val="0.01"/>
......@@ -1756,11 +1725,11 @@ Tap#</dia:string>
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:connections>
<dia:connection handle="0" to="O35" connection="3"/>
<dia:connection handle="1" to="O36" connection="6"/>
<dia:connection handle="0" to="O34" connection="3"/>
<dia:connection handle="1" to="O35" connection="7"/>
</dia:connections>
</dia:object>
<dia:object type="Standard - BezierLine" version="0" id="O45">
<dia:object type="Standard - BezierLine" version="0" id="O44">
<dia:attribute name="obj_pos">
<dia:point val="22.5427,32.7841"/>
</dia:attribute>
......@@ -1787,11 +1756,11 @@ Tap#</dia:string>
<dia:real val="0.80000000000000004"/>
</dia:attribute>
<dia:connections>
<dia:connection handle="0" to="O25" connection="2"/>
<dia:connection handle="0" to="O24" connection="2"/>
<dia:connection handle="3" to="O0" connection="2"/>
</dia:connections>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O46">
<dia:object type="Standard - Text" version="1" id="O45">
<dia:attribute name="obj_pos">
<dia:point val="26.2,27.525"/>
</dia:attribute>
......@@ -1824,7 +1793,7 @@ Tap#</dia:string>
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Arc" version="0" id="O47">
<dia:object type="Standard - Arc" version="0" id="O46">
<dia:attribute name="obj_pos">
<dia:point val="13.1503,27.0359"/>
</dia:attribute>
......@@ -1855,7 +1824,7 @@ Tap#</dia:string>
<dia:connection handle="1" to="O1" connection="7"/>
</dia:connections>
</dia:object>
<dia:object type="Standard - Text" version="1" id="O48">
<dia:object type="Standard - Text" version="1" id="O47">
<dia:attribute name="obj_pos">
<dia:point val="19.8272,20.6239"/>
</dia:attribute>
......@@ -1890,5 +1859,33 @@ and !TDG
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
<dia:object type="Standard - Line" version="0" id="O48">
<dia:attribute name="obj_pos">
<dia:point val="5.44128,19.5885"/>
</dia:attribute>
<dia:attribute name="obj_bb">
<dia:rectangle val="4.97124,15.4384;5.93303,19.6387"/>
</dia:attribute>
<dia:attribute name="conn_endpoints">
<dia:point val="5.44128,19.5885"/>
<dia:point val="5.45503,15.5502"/>
</dia:attribute>
<dia:attribute name="numcp">
<dia:int val="1"/>
</dia:attribute>
<dia:attribute name="end_arrow">
<dia:enum val="1"/>
</dia:attribute>
<dia:attribute name="end_arrow_length">
<dia:real val="0.79999999999999993"/>
</dia:attribute>
<dia:attribute name="end_arrow_width">
<dia:real val="0.79999999999999993"/>
</dia:attribute>
<dia:connections>
<dia:connection handle="0" to="O2" connection="1"/>
<dia:connection handle="1" to="O35" connection="6"/>
</dia:connections>
</dia:object>
</dia:layer>
</dia:diagram>
......@@ -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)
......@@ -2046,13 +2046,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)
......@@ -3206,20 +3203,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)
......
......@@ -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 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment