aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2011-04-15 12:14:03 -0400
committerPeter Hutterer <peter.hutterer@who-t.net>2011-04-18 13:56:32 +1000
commitebe41bfba77ba9c95d990d47d5e8f5a8a4f7477e (patch)
treea14751adac3b49e8f5ffdb561e9d2d391b5be135
parentEnsure all known valuator values are stored when out of proximity (diff)
downloadxf86-input-evdev-ebe41bfba77ba9c95d990d47d5e8f5a8a4f7477e.tar.gz
xf86-input-evdev-ebe41bfba77ba9c95d990d47d5e8f5a8a4f7477e.tar.bz2
xf86-input-evdev-ebe41bfba77ba9c95d990d47d5e8f5a8a4f7477e.zip
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>
-rw-r--r--src/evdev.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/evdev.c b/src/evdev.c
index bad7bb8..b1a822b 100644
--- a/src/evdev.c
+++ b/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;