1 commit b80f653bf33ed0ec23223a9877068cba97850ed1
2 Author: Lars-Peter Clausen <lars@metafoo.de>
3 Date: Wed Feb 18 23:08:14 2009 +0100
5 Transform touchscreen coordinates according to randr rotation.
7 diff --git a/src/tslib.c b/src/tslib.c
8 index 3eba078..6091006 100644
12 #include <exevents.h> /* Needed for InitValuator/Proximity stuff */
13 #include <X11/keysym.h>
14 #include <mipointer.h>
15 +#include <randrstr.h>
19 @@ -128,6 +129,8 @@ static void ReadInput (LocalDevicePtr local)
20 struct ts_sample samp;
23 + ScrnInfoPtr pScrn = xf86Screens[priv->screen_num];
24 + Rotation rotation = rrGetScrPriv (pScrn->pScreen) ? RRGetRotation(pScrn->pScreen) : RR_Rotate_0;
26 ret = ts_read(priv->ts, &samp, 1);
28 @@ -154,6 +157,23 @@ static void ReadInput (LocalDevicePtr local)
36 + samp.x = (priv->height - samp.y - 1) * priv->width / priv->height;
37 + samp.y = tmp_x * priv->height / priv->width;
40 + samp.x = priv->width - samp.x - 1;
41 + samp.y = priv->height - samp.y - 1;
44 + samp.x = samp.y * priv->width / priv->height;
45 + samp.y = (priv->width - tmp_x - 1) * priv->height / priv->width;