diff options
author | David Woodhouse <dwmw2@infradead.org> | 2009-12-01 00:12:36 +0000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-12-03 09:27:25 +1000 |
commit | 3772676fd65065b43a94234127537ab5030b09f8 (patch) | |
tree | 60d07b49d8a6faf427425a18020f6626b4e8f95f | |
parent | 4f05afd495214ad48ffab7bdb1cde69aacc5af8f (diff) |
Swap axes before applying touch screen calibration.
When the SwapAxes option is set, the X and Y axes in calibration should
be labelled as the user perceives them -- not as the kernel sends them.
Currently, we apply the X-axis calibration to the X-axis of the input,
and then do the axis swapping so we've actually applied the X-axis
calibration to what the user sees as the Y-axis.
This patch changes the order of the operations, so that the axes are
swapped before the calibration is applied.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit f187badb71554a73bf9ca30ce75c9d166e688f03)
-rw-r--r-- | src/evdev.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/evdev.c b/src/evdev.c index 33e02ab..bf0e760 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -464,6 +464,13 @@ EvdevProcessValuators(InputInfoPtr pInfo, int v[MAX_VALUATORS], int *num_v, */ else if (pEvdev->abs && pEvdev->tool) { memcpy(v, pEvdev->vals, sizeof(int) * pEvdev->num_vals); + + if (pEvdev->swap_axes) { + int tmp = v[0]; + v[0] = v[1]; + v[1] = tmp; + } + if (pEvdev->flags & EVDEV_CALIBRATED) { v[0] = xf86ScaleAxis(v[0], @@ -476,12 +483,6 @@ EvdevProcessValuators(InputInfoPtr pInfo, int v[MAX_VALUATORS], int *num_v, pEvdev->calibration.max_y, pEvdev->calibration.min_y); } - if (pEvdev->swap_axes) { - int tmp = v[0]; - v[0] = v[1]; - v[1] = tmp; - } - if (pEvdev->invert_x) v[0] = (pEvdev->absinfo[ABS_X].maximum - v[0] + pEvdev->absinfo[ABS_X].minimum); |