summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-09-05 10:21:32 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-09-05 10:21:32 +0200
commit10c4b02e205cf2e4c7f14fb5d0b468e1ef3b5b81 (patch)
treedc361f304c898c6a4e99c8acc02fd3b6aa12a851
parent86d55b7bec2ebbd38d982d54011536f8f0161a35 (diff)
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 <rydberg@euromail.se>
-rw-r--r--src/mtview.c2
1 files changed, 2 insertions, 0 deletions
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);
}