summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2012-03-21 12:58:27 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2012-03-22 14:27:30 +1000
commit93c72117e169624854f6eb63591702d7e4dae97c (patch)
treee2424665f84821ec7cfa34ea49e3f8c15b8acd12
parent5cde789fcafaed47c2533c4315e5c7d5548605f5 (diff)
Fix clickfinger actions when middle button emulation is enabled
When MBE is enabled, a physical left button press is delayed until a timeout is reached. This results in the logical left button being depressed while the physical left button is pressed. The physical state is stored as the "old" hw state, and it is used for detecting a transition from depressed to pressed for clickfinger actions. Since the "old" hw state shows the left button pressed, but the current logical state shows the left button unpressed, when the MBE timeout fires and we set the logical left button pressed the transition check fails. Since the "old" hw state is only used for clickfinger left button press transitions, redefining it to hold the previous logical hw state is sufficient for fixing the bug and should not cause any regressions. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/synaptics.c5
-rw-r--r--src/synapticsstr.h2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index 489eeaa..9f214e5 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1611,7 +1611,6 @@ ReadInput(InputInfoPtr pInfo)
SynapticsCopyHwState(priv->hwState, hw);
delay = HandleState(pInfo, hw, hw->millis, FALSE);
- SynapticsCopyHwState(priv->old_hw_state, priv->hwState);
newDelay = TRUE;
}
@@ -3236,6 +3235,10 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now,
/* generate a history of the absolute positions */
if (inside_active_area)
store_history(priv, hw->x, hw->y, hw->millis);
+
+ /* Save logical state for transition comparisons */
+ SynapticsCopyHwState(priv->old_hw_state, hw);
+
return delay;
}
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index fcefc46..55aab3d 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -196,7 +196,7 @@ struct _SynapticsPrivateRec
void *proto_data; /* protocol-specific data */
struct SynapticsHwState *hwState;
- struct SynapticsHwState *old_hw_state; /* previous hw state */
+ struct SynapticsHwState *old_hw_state; /* previous logical hw state */
const char *device; /* device node */
Bool shm_config; /* True when shared memory area allocated */