summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/eventcomm.c5
-rw-r--r--src/synaptics.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 94f6bc7..152f973 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -667,8 +667,9 @@ EventReadHwState(InputInfoPtr pInfo,
SynapticsResetTouchHwState(hw, FALSE);
- /* Reset cumulative values if buttons were not previously pressed */
- if (!hw->left && !hw->right && !hw->middle) {
+ /* Reset cumulative values if buttons were not previously pressed,
+ * or no finger was previously present. */
+ if ((!hw->left && !hw->right && !hw->middle) || hw->z < para->finger_low) {
hw->cumulative_dx = hw->x;
hw->cumulative_dy = hw->y;
sync_cumulative = TRUE;
diff --git a/src/synaptics.c b/src/synaptics.c
index 505e0f7..a8abdb2 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2781,6 +2781,12 @@ update_hw_button_state(const InputInfoPtr pInfo, struct SynapticsHwState *hw,
if (para->clickpad) {
/* hw->left is down, but no other buttons were already down */
if (!(priv->lastButtons & 7) && hw->left && !hw->right && !hw->middle) {
+ /* If the finger down event is delayed, the x and y
+ * coordinates are stale so we delay processing the click */
+ if (hw->z < para->finger_low) {
+ hw->left = 0;
+ goto out;
+ }
if (is_inside_rightbutton_area(para, hw->x, hw->y)) {
hw->left = 0;
hw->right = 1;
@@ -2812,6 +2818,7 @@ update_hw_button_state(const InputInfoPtr pInfo, struct SynapticsHwState *hw,
if (hw->left && !(priv->lastButtons & 7) && hw->numFingers >= 1)
handle_clickfinger(priv, hw);
+out:
/* Two finger emulation */
if (hw->numFingers == 1 && hw->z >= para->emulate_twofinger_z &&
hw->fingerWidth >= para->emulate_twofinger_w) {