aboutsummaryrefslogtreecommitdiffstats
path: root/src/hwstate.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-04-18 09:10:36 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-04-18 09:58:49 +0200
commit182d9419ded03262166514e3c76033a8daa14141 (patch)
tree3265ebe907591793ee73c0186be3e0d810716722 /src/hwstate.c
parent923754e3b864c33e23725435ae5049354a8ac5aa (diff)
downloadxorg-input-kobomultitouch-182d9419ded03262166514e3c76033a8daa14141.tar.gz
xorg-input-kobomultitouch-182d9419ded03262166514e3c76033a8daa14141.tar.bz2
xorg-input-kobomultitouch-182d9419ded03262166514e3c76033a8daa14141.zip
Filter non-zero finger width events
Add filtering also to touch/width events, but be careful to treat a zero touch exactly as zero. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/hwstate.c')
-rw-r--r--src/hwstate.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/hwstate.c b/src/hwstate.c
index d758d25..07bab31 100644
--- a/src/hwstate.c
+++ b/src/hwstate.c
@@ -69,14 +69,24 @@ static void set_finger(struct FingerState *fs,
{
int x = defuzz(hw->position_x, fs->hw.position_x, caps->xfuzz);
int y = defuzz(hw->position_y, fs->hw.position_y, caps->yfuzz);
- fs->hw = *hw;
+ int tj = defuzz(hw->touch_major, fs->hw.touch_major, caps->wfuzz);
+ int tn = defuzz(hw->touch_minor, fs->hw.touch_minor, caps->wfuzz);
+ int wj = defuzz(hw->width_major, fs->hw.width_major, caps->wfuzz);
+ int wn = defuzz(hw->width_minor, fs->hw.width_minor, caps->wfuzz);
fs->id = id;
+ fs->hw = *hw;
+ fs->hw.position_x = x;
+ fs->hw.position_y = y;
+ if (hw->touch_major) {
+ fs->hw.touch_major = tj;
+ fs->hw.touch_minor = tn;
+ }
+ fs->hw.width_major = wj;
+ fs->hw.width_minor = wn;
if (!caps->has_touch_minor)
fs->hw.touch_minor = hw->touch_major;
if (!caps->has_width_minor)
fs->hw.width_minor = hw->width_major;
- fs->hw.position_x = x;
- fs->hw.position_y = y;
}
void modify_hwstate(struct HWState *s,