[PATCH xglamo] Fix touchscreen x-coord when rotated.
Chris Ball
cjb at laptop.org
Thu Aug 7 04:27:14 CEST 2008
Hi,
Here's a tested patch to fix http://docs.openmoko.org/trac/ticket/1244,
please apply.
Thanks from a very happy Freerunner owner,
- Chris.
From: Chris Ball <cjb at laptop.org>
Date: Wed, 6 Aug 2008 21:42:58 -0400
Subject: [PATCH] Fix x-coord of input when rotated.
It seems that KdComputeMouseMatrix() requires us to call it after setting
up the desired randr, but before we set pScreen->{width,height} to our
new orientation. This patch does that, with the result that rotating to
left/right no longer introduces a 120px xcoord offset. Fixes Trac #1244.
Signed-off-by: Chris Ball <cjb at laptop.org>
---
hw/kdrive/glamo/glamo.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/hw/kdrive/glamo/glamo.c b/hw/kdrive/glamo/glamo.c
index 2c353ec..1ceebd0 100644
--- a/hw/kdrive/glamo/glamo.c
+++ b/hw/kdrive/glamo/glamo.c
@@ -420,14 +420,16 @@ glamoSetScannoutGeometry (ScreenPtr pScreen,
priv->var.xres, priv->var.yres, priv->fix.line_length,
priv->var.xres_virtual, priv->var.yres_virtual,
priv->var.rotate);
- pScreen->width = screen->width = priv->var.xres;
- pScreen->height = screen->height = priv->var.yres;
- screen->fb[0].byteStride =
- screen->width * screen->fb[0].bitsPerPixel / 8;
screen->randr = rotation;
memset(&m, 0, sizeof(m));
KdComputeMouseMatrix(&m, screen->randr, screen->width, screen->height);
KdSetMouseMatrix(&m);
+
+ pScreen->width = screen->width = priv->var.xres;
+ pScreen->height = screen->height = priv->var.yres;
+ screen->fb[0].byteStride =
+ screen->width * screen->fb[0].bitsPerPixel / 8;
+
/*TODO: not yet supported by glamo fb module*/
pScreen->mmWidth = priv->var.width;
pScreen->mmHeight = priv->var.height;
--
1.5.6.4
--
Chris Ball <cjb at laptop.org>
One Laptop per Child
More information about the devel
mailing list