--- a/dix/getevents.c 2011-12-18 06:44:54.000000000 +0200 +++ b/dix/getevents.c 2012-05-15 13:23:04.542226860 +0300 @@ -1078,10 +1078,24 @@ { int x, y, ox, oy; - ox = x = valuator_mask_isset(mask, 0) ? valuator_mask_get(mask, 0) : - dev->last.valuators[0]; - oy = y = valuator_mask_isset(mask, 1) ? valuator_mask_get(mask, 1) : - dev->last.valuators[1]; + if (!valuator_mask_isset(mask, 0) || !valuator_mask_isset(mask, 1)) { + 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(mask, 0); + if (valuator_mask_isset(mask, 1)) + oy = y = valuator_mask_get(mask, 1); transform(&dev->transform, &x, &y);