[PATCH xf86-input-synaptics v2 11/13] Filter touch events if click actions are enabled
Chase Douglas
chase.douglas at canonical.com
Thu Feb 9 18:24:55 PST 2012
Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
---
src/synaptics.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/synaptics.c b/src/synaptics.c
index 3d31424..412a4cf 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2592,10 +2592,17 @@ HandleTouches(InputInfoPtr pInfo, struct SynapticsHwState *hw)
{
#ifdef HAVE_MULTITOUCH
SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
+ SynapticsParameters *para = &priv->synpara;
int new_active_touches = priv->num_active_touches;
+ int min_touches = 2;
Bool restart_touches = FALSE;
int i;
+ if (para->click_action[F3_CLICK1])
+ min_touches = 4;
+ else if (para->click_action[F2_CLICK1])
+ min_touches = 3;
+
/* Count new number of active touches */
for (i = 0; i < hw->num_mt_mask; i++)
{
@@ -2605,11 +2612,13 @@ HandleTouches(InputInfoPtr pInfo, struct SynapticsHwState *hw)
new_active_touches--;
}
- if (priv->num_active_touches < 2 && new_active_touches < 2)
+ if (priv->num_active_touches < min_touches &&
+ new_active_touches < min_touches)
{
/* We stayed below number of touches needed to send events */
goto out;
- } else if (priv->num_active_touches >= 2 && new_active_touches < 2)
+ } else if (priv->num_active_touches >= min_touches &&
+ new_active_touches < min_touches)
{
/* We are transitioning to less than the number of touches needed to
* send events. End all currently open touches. */
@@ -2622,7 +2631,8 @@ HandleTouches(InputInfoPtr pInfo, struct SynapticsHwState *hw)
/* Don't send any more events */
goto out;
- } else if (priv->num_active_touches < 2 && new_active_touches >= 2)
+ } else if (priv->num_active_touches < min_touches &&
+ new_active_touches >= min_touches)
{
/* We are transitioning to more than the number of touches needed to
* send events. Begin all already open touches. */
--
1.7.8.3
More information about the xorg-devel
mailing list