summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-09-20 05:56:39 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-09-27 14:27:18 +1000
commite31e272f4fc8b2aa8e2101b89bb65bc1d6a5e1be (patch)
tree4ba475b7082654f2c2b340debcfc2f336d66853d
parentf0bad69edd57facd6cffde8cb0863d1a735e2492 (diff)
dix: set the device transformation matrix
The property handler is registered after setting the property, so dev->transform remains as all-zeros. That causes pixman_f_transform_invert() to fail (in transformAbsolute()) and invert remains as garbage. This may then cause a cursor jump to 0,0. Since the axes are not yet initialized here and we need to allow for drivers changing the matrix, we cannot use the property handler for matrix initialization, essentially duplicating the code. Triggered by the fix to (#49347) in 749a593e49adccdf1225be28a521412ec85333f4 https://bugzilla.redhat.com/show_bug.cgi?id=852841 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@ubuntu.com> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 3d1051aecbb1955084804133cacd12c7f696833a)
-rw-r--r--dix/devices.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/dix/devices.c b/dix/devices.c
index 9cf04ed3f..66d440683 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -306,6 +306,9 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
/* unity matrix */
memset(transform, 0, sizeof(transform));
transform[0] = transform[4] = transform[8] = 1.0f;
+ dev->transform.m[0][0] = 1.0;
+ dev->transform.m[1][1] = 1.0;
+ dev->transform.m[2][2] = 1.0;
XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_TRANSFORM),
XIGetKnownProperty(XATOM_FLOAT), 32,