summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2007-08-31 20:59:34 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2007-08-31 20:59:34 +0000
commitdddc7cd5c466560612926fde63ab8596b53f46c3 (patch)
tree53d1a2d21afbe069ed21f28cd4c579e4fc82b81a
parent7f70e747437b5bcf5f52166b1671fc1cded20760 (diff)
Remove the useless ts structure, and fix the setting
of the new calibration values.
-rw-r--r--app/xtsscale/xtsscale.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/app/xtsscale/xtsscale.c b/app/xtsscale/xtsscale.c
index a91c92d69..446485932 100644
--- a/app/xtsscale/xtsscale.c
+++ b/app/xtsscale/xtsscale.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xtsscale.c,v 1.3 2007/08/31 20:28:18 matthieu Exp $ */
+/* $OpenBSD: xtsscale.c,v 1.4 2007/08/31 20:59:33 matthieu Exp $ */
/*
* Copyright (c) 2007 Robert Nagy <robert@openbsd.org>
*
@@ -279,14 +279,6 @@ main(int argc, char *argv[], char *env[])
int cpx[] = { 0, 0, 1, 1, 1 };
int cpy[] = { 0, 1, 0, 0, 1 };
- struct tsscale {
- int ts_minx;
- int ts_maxx;
- int ts_miny;
- int ts_maxy;
- int ts_swapxy;
- } ts;
-
if (argc != 2) {
fprintf(stderr, "usage: %s <device>\n", __progname);
return 1;
@@ -373,8 +365,8 @@ calib:
fabs(xerr));
goto calib;
}
- ts.ts_minx = (int) (b + 0.5);
- ts.ts_maxx = (int) (a * width + b + 0.5);
+ wmcoords.minx = (int) (b + 0.5);
+ wmcoords.maxx = (int) (a * width + b + 0.5);
/* get touch pad resolution to screen resolution ratio */
a1 = (double) (y[4] - y[0]) / (double) (cy[4] - cy[0]);
@@ -391,19 +383,23 @@ calib:
fabs(yerr));
goto calib;
}
- ts.ts_miny = (int) (b + 0.5);
- ts.ts_maxy = (int) (a * height + b + 0.5);
+ wmcoords.miny = (int) (b + 0.5);
+ wmcoords.maxy = (int) (a * height + b + 0.5);
XFlush(display);
wmcoords.samplelen = orawmode;
+ wmcoords.resx = width;
+ wmcoords.resy = height;
if (ioctl(evfd, WSMOUSEIO_SCALIBCOORDS, &wmcoords) < 0)
err(1, "WSMOUSEIO_SCALIBCOORDS");
printf("mouse.scale=%d,%d,%d,%d,%d,%d,%d\n",
- ts.ts_minx, ts.ts_maxx, ts.ts_miny,
- ts.ts_maxy, wmcoords.swapxy, width, height);
-
+ wmcoords.minx, wmcoords.maxx,
+ wmcoords.miny, wmcoords.maxy,
+ wmcoords.swapxy,
+ wmcoords.resx, wmcoords.resy);
+
return 0;
}