aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/getevents.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-05-21 09:28:15 +0200
committermarha <marha@users.sourceforge.net>2012-05-21 09:28:15 +0200
commitd4b066581bc9a4bf7b0a5ffa11ff0adb47d2075c (patch)
treedb56fe01d61a824e4bd975cbf8603b11e9c5ecdf /xorg-server/dix/getevents.c
parentd2dacc6bc44f7dc245dee6e66723013afb49cfb5 (diff)
parentf543ceaca6820260f15a4eff86938214cf43c7d2 (diff)
downloadvcxsrv-d4b066581bc9a4bf7b0a5ffa11ff0adb47d2075c.tar.gz
vcxsrv-d4b066581bc9a4bf7b0a5ffa11ff0adb47d2075c.tar.bz2
vcxsrv-d4b066581bc9a4bf7b0a5ffa11ff0adb47d2075c.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'xorg-server/dix/getevents.c')
-rw-r--r--xorg-server/dix/getevents.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/xorg-server/dix/getevents.c b/xorg-server/dix/getevents.c
index e0ef18365..be369ec72 100644
--- a/xorg-server/dix/getevents.c
+++ b/xorg-server/dix/getevents.c
@@ -1187,16 +1187,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)
+ return;
+
+ 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);
- else
- ox = x = dev->last.valuators[0];
if (valuator_mask_isset(mask, 1))
oy = y = valuator_mask_get_double(mask, 1);
- else
- oy = y = dev->last.valuators[1];
transform(&dev->transform, &x, &y);