mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-03-25 10:19:22 +00:00
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:
committed by
Peter Hutterer
parent
68a6a18fc2
commit
ebe41bfba7
15
src/evdev.c
15
src/evdev.c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user