summaryrefslogtreecommitdiff
path: root/packages/xorg-driver/xf86-input-tslib/01_fix-wrong-value-range-for-the-axises.diff
diff options
context:
space:
mode:
authorGraeme Gregory <dp@xora.org.uk>2008-11-11 15:17:49 +0100
committerKoen Kooi <koen@openembedded.org>2008-11-11 15:17:49 +0100
commit8c676179c23de3ddd0c135ab0fa4e38d0f503cab (patch)
treef7bd6e5a562ac31fa3e13623e47edca5b19dddac /packages/xorg-driver/xf86-input-tslib/01_fix-wrong-value-range-for-the-axises.diff
parentbee34861034d53a97cdca02b8641ca8d4da66c3e (diff)
xf86-input-tslib_0.0.5.bb : add rotation handling patch from debian and
my own experimental dynamic resolution patch. Using Xorg to tell us what resolution we run at, not assuming hardcoded defaults.
Diffstat (limited to 'packages/xorg-driver/xf86-input-tslib/01_fix-wrong-value-range-for-the-axises.diff')
-rw-r--r--packages/xorg-driver/xf86-input-tslib/01_fix-wrong-value-range-for-the-axises.diff47
1 files changed, 47 insertions, 0 deletions
diff --git a/packages/xorg-driver/xf86-input-tslib/01_fix-wrong-value-range-for-the-axises.diff b/packages/xorg-driver/xf86-input-tslib/01_fix-wrong-value-range-for-the-axises.diff
new file mode 100644
index 0000000000..b5407102b9
--- /dev/null
+++ b/packages/xorg-driver/xf86-input-tslib/01_fix-wrong-value-range-for-the-axises.diff
@@ -0,0 +1,47 @@
+--- xf86-input-tslib-0.0.5.orig/src/tslib.c
++++ xf86-input-tslib-0.0.5/src/tslib.c
+@@ -183,7 +185,7 @@
+ {
+ InputInfoPtr pInfo;
+ unsigned char map[MAXBUTTONS + 1];
+- int i;
++ int i, axiswidth, axisheight;
+ struct ts_priv *priv;
+
+ ErrorF("%s\n", __FUNCTION__);
+@@ -212,17 +226,29 @@
+ return !Success;
+ }
+
++ switch(priv->rotate) {
++ case TSLIB_ROTATE_CW:
++ case TSLIB_ROTATE_CCW:
++ axiswidth = priv->height;
++ axisheight = priv->width;
++ break;
++ default:
++ axiswidth = priv->width;
++ axisheight = priv->height;
++ break;
++ }
++
+ InitValuatorAxisStruct(device, 0, 0, /* min val */
+- priv->width - 1, /* max val */
+- priv->width, /* resolution */
++ axiswidth - 1, /* max val */
++ axiswidth, /* resolution */
+ 0, /* min_res */
+- priv->width); /* max_res */
++ axiswidth); /* max_res */
+
+ InitValuatorAxisStruct(device, 1, 0, /* min val */
+- priv->height - 1,/* max val */
+- priv->height, /* resolution */
++ axisheight - 1, /* max val */
++ axisheight, /* resolution */
+ 0, /* min_res */
+- priv->height); /* max_res */
++ axisheight); /* max_res */
+
+ if (InitProximityClassDeviceStruct (device) == FALSE) {
+ ErrorF ("Unable to allocate EVTouch touchscreen ProximityClassDeviceStruct\n");