summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/synaptics.c13
-rw-r--r--src/synproto.c4
2 files changed, 15 insertions, 2 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index 78660f4..cd9f936 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -3278,6 +3278,19 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now,
return delay;
}
+ /* We need both and x/y, the driver can't handle just one of the two
+ * yet. But since it's possible to hit a phys button on non-clickpads
+ * without ever getting motion data first, we must continue with 0/0 for
+ * that case. */
+ if (hw->x == INT_MIN || hw->y == INT_MAX) {
+ if (para->clickpad)
+ return delay;
+ else if (hw->left || hw->right || hw->middle) {
+ hw->x = (hw->x == INT_MIN) ? 0 : hw->x;
+ hw->y = (hw->y == INT_MIN) ? 0 : hw->y;
+ }
+ }
+
/* If a physical button is pressed on a clickpad, use cumulative relative
* touch movements for motion */
if (para->clickpad && (hw->left || hw->right || hw->middle)) {
diff --git a/src/synproto.c b/src/synproto.c
index d6e8c65..0c8a066 100644
--- a/src/synproto.c
+++ b/src/synproto.c
@@ -134,8 +134,8 @@ void
SynapticsResetHwState(struct SynapticsHwState *hw)
{
hw->millis = 0;
- hw->x = 0;
- hw->y = 0;
+ hw->x = INT_MIN;
+ hw->y = INT_MIN;
hw->z = 0;
hw->cumulative_dx = 0;
hw->cumulative_dy = 0;