From 10c4b02e205cf2e4c7f14fb5d0b468e1ef3b5b81 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Sun, 5 Sep 2010 10:21:32 +0200 Subject: Temporarily make sure contact area is always defined Some devices do not always send touch_minor after touch_major has been set. According to the MT protocol, this case should be treated as if minor is equal to major. This patch makes sure touch_minor is never zero when touch_major is set. When grail v1.0.13 is out, this patch will no longer have any effect. Signed-off-by: Henrik Rydberg --- src/mtview.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mtview.c b/src/mtview.c index 8891987..f62d64d 100644 --- a/src/mtview.c +++ b/src/mtview.c @@ -55,6 +55,8 @@ static void output_touch(struct touch_dev *dev, struct windata *w, if (t->touch_major > 0 || t->touch_minor > 0) { major = t->touch_major; minor = t->touch_minor; + if (major && !minor) + minor = major; angle = touch_angle(dev, t->orientation); } -- cgit v1.2.3