diff options
-rw-r--r-- | src/synaptics.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/synaptics.c b/src/synaptics.c index 809a275..ee627b3 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -2956,14 +2956,23 @@ update_hw_button_state(const InputInfoPtr pInfo, struct SynapticsHwState *hw, /* If this is a clickpad and the user clicks in a soft button area, press * the soft button instead. */ - if (para->clickpad && hw->left && !hw->right && !hw->middle) { - if (is_inside_rightbutton_area(para, hw->x, hw->y)) { - hw->left = 0; - hw->right = 1; - } - else if (is_inside_middlebutton_area(para, hw->x, hw->y)) { - hw->left = 0; - hw->middle = 1; + if (para->clickpad) { + /* hw->left is down, but no other buttons were already down */ + if (!old->left && !old->right && !old->middle && + hw->left && !hw->right && !hw->middle) { + if (is_inside_rightbutton_area(para, hw->x, hw->y)) { + hw->left = 0; + hw->right = 1; + } + else if (is_inside_middlebutton_area(para, hw->x, hw->y)) { + hw->left = 0; + hw->middle = 1; + } + } + else if (hw->left) { + hw->left = old->left; + hw->right = old->right; + hw->middle = old->middle; } } |