diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2012-03-09 14:29:28 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-03-14 08:46:46 +1000 |
commit | 70b4e983c6626b9b20bdf59324f64b3fd99c5202 (patch) | |
tree | 5688cd7aa3e5f1ad88b5b9e2c42b6ff0967c2051 /src | |
parent | f6c1efbc6d22f41fb8a4abd2f57db173a2ac3171 (diff) |
Only handle ClickFingers on left button press events
ClickFingers doesn't need to be handled on every state, only when the actual
button state changes.
This is a break from the previous behaviour which allowed pressing the
button followed by a two-finger tap to trigger the ClickFinger2 action.
Let's see if anyone complains.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/synaptics.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/synaptics.c b/src/synaptics.c index 13f1378..e360238 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -2481,7 +2481,7 @@ adjust_state_from_scrollbuttons(const InputInfoPtr pInfo, struct SynapticsHwStat static void update_hw_button_state(const InputInfoPtr pInfo, struct SynapticsHwState *hw, - CARD32 now, int *delay) + struct SynapticsHwState *old, CARD32 now, int *delay) { SynapticsPrivate *priv = (SynapticsPrivate *) (pInfo->private); SynapticsParameters *para = &priv->synpara; @@ -2493,8 +2493,10 @@ update_hw_button_state(const InputInfoPtr pInfo, struct SynapticsHwState *hw, /* 3rd button emulation */ hw->middle |= HandleMidButtonEmulation(priv, hw, now, delay); - /* Fingers emulate other buttons */ - if(hw->left && hw->numFingers >= 1){ + /* Fingers emulate other buttons. ClickFinger can only be + triggered on transition, when left is pressed + */ + if(hw->left && !old->left && hw->numFingers >= 1) { handle_clickfinger(para, hw); } @@ -2824,7 +2826,7 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now, } /* these two just update hw->left, right, etc. */ - update_hw_button_state(pInfo, hw, now, &delay); + update_hw_button_state(pInfo, hw, priv->old_hw_state, now, &delay); if (priv->has_scrollbuttons) double_click = adjust_state_from_scrollbuttons(pInfo, hw); |