diff options
author | Henrik Rydberg <rydberg@euromail.se> | 2010-06-21 18:56:49 +0200 |
---|---|---|
committer | Henrik Rydberg <rydberg@euromail.se> | 2010-06-21 18:56:49 +0200 |
commit | 7380af2c93dc83f4f09e293717d46eadf7799e89 (patch) | |
tree | 2eb11199ef87e3181411bb848252bb5d6fed0be6 /driver | |
parent | 71168e1fb794f4a24e97177508bb1d54ae24b266 (diff) | |
download | xorg-input-kobomultitouch-7380af2c93dc83f4f09e293717d46eadf7799e89.tar.gz xorg-input-kobomultitouch-7380af2c93dc83f4f09e293717d46eadf7799e89.tar.bz2 xorg-input-kobomultitouch-7380af2c93dc83f4f09e293717d46eadf7799e89.zip |
Simplify event reading
This patch puts the reading code more in line with the upcoming
mtdev library, and should remove some spurious input behavior.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'driver')
-rw-r--r-- | driver/multitouch.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/driver/multitouch.c b/driver/multitouch.c index 73a025d..eef86c5 100644 --- a/driver/multitouch.c +++ b/driver/multitouch.c @@ -256,16 +256,13 @@ static void read_input(LocalDevicePtr local) { struct Gestures gs; struct MTouch *mt = local->private; - const struct input_event *ev; - while (ev = get_iobuf_event(&mt->buf, local->fd)) { - if (parse_event(mt, ev)) { - extract_gestures(&gs, mt); - handle_gestures(local, &gs, &mt->caps); - } - if (mt_is_idle(mt, local->fd)) { - extract_delayed_gestures(&gs, mt); - handle_gestures(local, &gs, &mt->caps); - } + while (read_packet(mt, local->fd) > 0) { + extract_gestures(&gs, mt); + handle_gestures(local, &gs, &mt->caps); + } + if (has_delayed_gestures(mt, local->fd)) { + extract_delayed_gestures(&gs, mt); + handle_gestures(local, &gs, &mt->caps); } } |