Copy out of proximity values into current values selectively

Otherwise, an event that causes us to go into proximity with some new
valuator values will retain some old valuator values from when last in
proximity. This change ensures that all values posted while out of
proximity are accounted for.

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
2011-04-15 12:14:03 -04:00
committed by Peter Hutterer
parent 68a6a18fc2
commit ebe41bfba7

View File

@@ -525,13 +525,14 @@ EvdevProcessProximityState(InputInfoPtr pInfo)
{
/* We're about to go into/out of proximity but have no abs events
* within the EV_SYN. Use the last coordinates we have. */
if (!pEvdev->abs_queued &&
valuator_mask_num_valuators(pEvdev->prox) > 0)
{
valuator_mask_copy(pEvdev->vals, pEvdev->prox);
valuator_mask_zero(pEvdev->prox);
pEvdev->abs_queued = 1;
}
for (i = 0; i < valuator_mask_size(pEvdev->prox); i++)
if (!valuator_mask_isset(pEvdev->vals, i) &&
valuator_mask_isset(pEvdev->prox, i))
valuator_mask_set(pEvdev->vals, i,
valuator_mask_get(pEvdev->prox, i));
valuator_mask_zero(pEvdev->prox);
pEvdev->abs_queued = valuator_mask_size(pEvdev->vals);
}
pEvdev->in_proximity = prox_state;