summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-04-30 11:39:49 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-05-02 10:44:55 +1000
commitd13e83b921a398b9472b07874cf5061c8a0ea6a6 (patch)
tree41afbb8c81c84c9d86253909a6c9f0d1e85b7ad3
parentcc595bd323aab2b0ef7b41fded2f0b5571cf0a8e (diff)
Force SLOTSTATE_EMPTY on DeviceOff
SLOTSTATE_OPEN_EMPTY on resume leads to erroneously detected touches. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
-rw-r--r--src/eventcomm.c2
-rw-r--r--src/synaptics.c6
-rw-r--r--src/synproto.c6
-rw-r--r--src/synproto.h2
4 files changed, 8 insertions, 8 deletions
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 741f988..4ef8ad6 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -662,7 +662,7 @@ EventReadHwState(InputInfoPtr pInfo,
SynapticsParameters *para = &priv->synpara;
struct eventcomm_proto_data *proto_data = priv->proto_data;
- SynapticsResetTouchHwState(hw);
+ SynapticsResetTouchHwState(hw, FALSE);
/* Reset cumulative values if buttons were not previously pressed */
if (!hw->left && !hw->right && !hw->middle)
diff --git a/src/synaptics.c b/src/synaptics.c
index 935650d..6dc8004 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -1619,7 +1619,7 @@ timerFunc(OsTimerPtr timer, CARD32 now, pointer arg)
priv->hwState->millis += now - priv->timer_time;
SynapticsCopyHwState(hw, priv->hwState);
- SynapticsResetTouchHwState(hw);
+ SynapticsResetTouchHwState(hw, FALSE);
delay = HandleState(pInfo, hw, hw->millis, TRUE);
priv->timer_time = now;
@@ -1659,7 +1659,7 @@ ReadInput(InputInfoPtr pInfo)
int delay = 0;
Bool newDelay = FALSE;
- SynapticsResetTouchHwState(hw);
+ SynapticsResetTouchHwState(hw, FALSE);
while (SynapticsGetHwState(pInfo, priv, hw)) {
/* Semi-mt device touch slots do not track touches. When there is a
@@ -3017,7 +3017,7 @@ UpdateTouchState(InputInfoPtr pInfo, struct SynapticsHwState *hw)
}
}
- SynapticsResetTouchHwState(hw);
+ SynapticsResetTouchHwState(hw, FALSE);
#endif
}
diff --git a/src/synproto.c b/src/synproto.c
index cf54c4d..8e67800 100644
--- a/src/synproto.c
+++ b/src/synproto.c
@@ -153,11 +153,11 @@ SynapticsResetHwState(struct SynapticsHwState *hw)
hw->middle = 0;
memset(hw->multi, 0, sizeof(hw->multi));
- SynapticsResetTouchHwState(hw);
+ SynapticsResetTouchHwState(hw, TRUE);
}
void
-SynapticsResetTouchHwState(struct SynapticsHwState *hw)
+SynapticsResetTouchHwState(struct SynapticsHwState *hw, Bool set_slot_empty)
{
#ifdef HAVE_MULTITOUCH
int i;
@@ -175,7 +175,7 @@ SynapticsResetTouchHwState(struct SynapticsHwState *hw)
case SLOTSTATE_OPEN:
case SLOTSTATE_OPEN_EMPTY:
case SLOTSTATE_UPDATE:
- hw->slot_state[i] = SLOTSTATE_OPEN_EMPTY;
+ hw->slot_state[i] = set_slot_empty ? SLOTSTATE_EMPTY : SLOTSTATE_OPEN_EMPTY;
break;
default:
diff --git a/src/synproto.h b/src/synproto.h
index 7f80bcd..413579d 100644
--- a/src/synproto.h
+++ b/src/synproto.h
@@ -120,7 +120,7 @@ extern void SynapticsHwStateFree(struct SynapticsHwState **hw);
extern void SynapticsCopyHwState(struct SynapticsHwState *dst,
const struct SynapticsHwState *src);
extern void SynapticsResetHwState(struct SynapticsHwState *hw);
-extern void SynapticsResetTouchHwState(struct SynapticsHwState *hw);
+extern void SynapticsResetTouchHwState(struct SynapticsHwState *hw, Bool force_empty);
extern Bool SynapticsIsSoftButtonAreasValid(int *values);