diff options
author | Chase Douglas <chase.douglas@ubuntu.com> | 2010-11-15 11:42:12 -0500 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-11-19 11:11:04 +1000 |
commit | 31737fff08ec19b394837341d5e358ec401f5cd8 (patch) | |
tree | a2277e77b0ef3e0ffb8430dba19d4917ddcf358e | |
parent | 463841f45aafd1227bac652965c9ea337dd527fa (diff) |
Fix transformAbsolute
transformAbsolute must use old values if valuator mask doesn't have new
ones, and it must only set new values if there was a change.
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | dix/getevents.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/dix/getevents.c b/dix/getevents.c index bc5841fed..a288e36d7 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -1057,14 +1057,18 @@ transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask) struct pixman_f_vector p; /* p' = M * p in homogeneous coordinates */ - p.v[0] = valuator_mask_get(mask, 0); - p.v[1] = valuator_mask_get(mask, 1); + p.v[0] = (valuator_mask_isset(mask, 0) ? valuator_mask_get(mask, 0) : + dev->last.valuators[0]); + p.v[1] = (valuator_mask_isset(mask, 1) ? valuator_mask_get(mask, 1) : + dev->last.valuators[1]); p.v[2] = 1.0; pixman_f_transform_point(&dev->transform, &p); - valuator_mask_set(mask, 0, lround(p.v[0])); - valuator_mask_set(mask, 1, lround(p.v[1])); + if (lround(p.v[0]) != dev->last.valuators[0]) + valuator_mask_set(mask, 0, lround(p.v[0])); + if (lround(p.v[1]) != dev->last.valuators[1]) + valuator_mask_set(mask, 1, lround(p.v[1])); } /** |