summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-05-09 12:23:46 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-05-11 10:27:58 +1000
commit04d24116db59872d4cd00f38a0d1c87957fe4914 (patch)
treedfa4984d603ea5ec0bf77e50e60f69def057fa19
parent4e8ddb3a6f1ba1f7642f0a23d6f22a8c40d68cf0 (diff)
Don't check for soft buttons if a button is already down
Moving into a different soft button's area during drag-n-drop would trigger a click of that button. We only have the current button state and we mess with it, so the conditions for a possible clickpad soft-button event are: - hw->left is down now - none of left|right|middle were down before. since we change hw->left to hw->right/left we need to check all three If hw->left is down but one of the other buttons was already down, copy that button state and continue. http://bugzilla.redhat.com/819348 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com> (cherry picked from commit a1d6784d790f081f8a6ea3a10d3cfa578aa10d5b)
-rw-r--r--src/synaptics.c25
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;
}
}