Commit 889ce069 authored by Peter Hutterer's avatar Peter Hutterer

dix: undo transformation for missing valuators (#49347)

last.valuators contains the transformed valuators of the device. If the
device submits events with x/y missing, we need to get that from
last.valuators and undo the transformation to that axis.

X.Org Bug 49347 <>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <>
Reviewed-by: default avatarChase Douglas <>
(cherry picked from commit 749a593e)
parent 4c21adab
......@@ -1151,16 +1151,33 @@ static void
transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
double x, y, ox, oy;
int has_x, has_y;
has_x = valuator_mask_fetch_double(mask, 0, &ox);
has_y = valuator_mask_fetch_double(mask, 1, &oy);
if (!has_x && !has_y)
if (!has_x || !has_y) {
struct pixman_f_transform invert;
/* undo transformation from last event */
ox = dev->last.valuators[0];
oy = dev->last.valuators[1];
pixman_f_transform_invert(&invert, &dev->transform);
transform(&invert, &ox, &oy);
x = ox;
y = oy;
if (valuator_mask_isset(mask, 0))
ox = x = valuator_mask_get_double(mask, 0);
ox = x = dev->last.valuators[0];
if (valuator_mask_isset(mask, 1))
oy = y = valuator_mask_get_double(mask, 1);
oy = y = dev->last.valuators[1];
transform(&dev->transform, &x, &y);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment