diff options
author | Chase Douglas <chase.douglas@canonical.com> | 2012-02-09 09:55:17 -0800 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-02-11 07:46:05 +1000 |
commit | 061e4a259644408899e03ba5abdd979691a02b1a (patch) | |
tree | b7904ad867b518965000dd1e6fffdb4634c4ac6a /src/synaptics.c | |
parent | 336f9a09d090a8c3a9c976ab04ffb17bcdc2c2ea (diff) |
Filter touch events if click actions are enabled
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/synaptics.c')
-rw-r--r-- | src/synaptics.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/synaptics.c b/src/synaptics.c index 0dd4fb2..56caf35 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -2601,10 +2601,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++) { @@ -2614,11 +2621,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. */ @@ -2631,7 +2640,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. */ |