From 7380af2c93dc83f4f09e293717d46eadf7799e89 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Mon, 21 Jun 2010 18:56:49 +0200 Subject: 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 --- driver/multitouch.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'driver') 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); } } -- cgit v1.2.3