summaryrefslogtreecommitdiff
path: root/src/evdev.c
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2019-08-04 11:48:28 -0400
committerPeter Hutterer <peter.hutterer@who-t.net>2019-08-05 09:58:06 +1000
commit801485afda09e5fcf8b2fda59292f496d71d02ae (patch)
tree6eefb8593b3b3d219ad67cbd1f9e8d4d993ab9ab /src/evdev.c
parentf5fc850a0805045964c9056c4b91e161ab70d5bd (diff)
downloadlibinput-801485afda09e5fcf8b2fda59292f496d71d02ae.tar.gz
evdev: always store user calibration matrix
In evdev_device_calibrate, the user matrix was not being stored when it was the identity matrix. This resulted in libinput_device_config_calibration_get_matrix not providing the correct matrix. Instead of giving the identity matrix, the last non-identity matrix set was given. This just moves the storage of the user matrix in evdev_device_calibrate to be above the identity matrix early return so that it always get stored. Signed-off-by: Brian Ashworth <bosrsf04@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/evdev.c')
-rw-r--r--src/evdev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 7b18cbe2..8afa8e46 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -2210,6 +2210,9 @@ evdev_device_calibrate(struct evdev_device *device,
matrix_from_farray6(&transform, calibration);
device->abs.apply_calibration = !matrix_is_identity(&transform);
+ /* back up the user matrix so we can return it on request */
+ matrix_from_farray6(&device->abs.usermatrix, calibration);
+
if (!device->abs.apply_calibration) {
matrix_init_identity(&device->abs.calibration);
return;
@@ -2238,9 +2241,6 @@ evdev_device_calibrate(struct evdev_device *device,
* order.
*/
- /* back up the user matrix so we can return it on request */
- matrix_from_farray6(&device->abs.usermatrix, calibration);
-
/* Un-Normalize */
matrix_init_translate(&translate,
device->abs.absinfo_x->minimum,