[PATCH xf86-input-synaptics 3/4] Keep track of which touch slots are open
Chase Douglas
chase.douglas at canonical.com
Wed Mar 21 12:58:29 PDT 2012
This change adds a new touch slot state that denotes when the slot is
open but does not have any new data to report.
Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
---
src/eventcomm.c | 3 ++-
src/synproto.c | 13 ++++++++++++-
src/synproto.h | 1 +
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/eventcomm.c b/src/eventcomm.c
index f199c24..3721c91 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -557,7 +557,8 @@ EventProcessTouchEvent(InputInfoPtr pInfo, struct SynapticsHwState *hw,
{
int slot_index = last_mt_vals_slot(priv);
- if (hw->slot_state[slot_index] == SLOTSTATE_EMPTY)
+ if (hw->slot_state[slot_index] == SLOTSTATE_EMPTY ||
+ hw->slot_state[slot_index] == SLOTSTATE_OPEN_EMPTY)
hw->slot_state[slot_index] = SLOTSTATE_UPDATE;
if (ev->code == ABS_MT_TRACKING_ID)
{
diff --git a/src/synproto.c b/src/synproto.c
index bdf2d21..19a13e5 100644
--- a/src/synproto.c
+++ b/src/synproto.c
@@ -152,7 +152,18 @@ SynapticsResetTouchHwState(struct SynapticsHwState *hw)
for (j = 2; j < valuator_mask_num_valuators(hw->mt_mask[i]); j++)
valuator_mask_unset(hw->mt_mask[i], j);
- hw->slot_state[i] = SLOTSTATE_EMPTY;
+ switch (hw->slot_state[i])
+ {
+ case SLOTSTATE_OPEN:
+ case SLOTSTATE_OPEN_EMPTY:
+ case SLOTSTATE_UPDATE:
+ hw->slot_state[i] = SLOTSTATE_OPEN_EMPTY;
+ break;
+
+ default:
+ hw->slot_state[i] = SLOTSTATE_EMPTY;
+ break;
+ }
}
#endif
}
diff --git a/src/synproto.h b/src/synproto.h
index 95ebc92..e16aeb0 100644
--- a/src/synproto.h
+++ b/src/synproto.h
@@ -42,6 +42,7 @@ enum SynapticsSlotState
SLOTSTATE_EMPTY = 0,
SLOTSTATE_OPEN,
SLOTSTATE_CLOSE,
+ SLOTSTATE_OPEN_EMPTY,
SLOTSTATE_UPDATE,
};
--
1.7.9.1
More information about the xorg-devel
mailing list