Keep track of which touch slots are open

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@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Chase Douglas
2012-03-21 12:58:29 -07:00
committed by Peter Hutterer
parent 73ec252b6f
commit eba82d203e
3 changed files with 15 additions and 2 deletions

View File

@@ -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)
{

View File

@@ -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
}

View File

@@ -42,6 +42,7 @@ enum SynapticsSlotState
SLOTSTATE_EMPTY = 0,
SLOTSTATE_OPEN,
SLOTSTATE_CLOSE,
SLOTSTATE_OPEN_EMPTY,
SLOTSTATE_UPDATE,
};