From d638d408615427196b031692f8fd14a83a790d30 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Tue, 21 Sep 2010 10:18:09 +0200 Subject: bug: Only report position change events This bug was introduced in v1.0.11. Only report events when the pointer position is actually changing. Signed-off-by: Henrik Rydberg --- src/grail-api.c | 10 ++++++++-- src/grail-impl.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/grail-api.c b/src/grail-api.c index 9490659..d4ad83d 100644 --- a/src/grail-api.c +++ b/src/grail-api.c @@ -80,8 +80,14 @@ static void handle_abs_events(struct grail *ge, const struct input_event *syn) impl->pointer_status = pointer; } if (pointer) { - evput(impl, syn->time, EV_ABS, ABS_X, impl->pointer_x); - evput(impl, syn->time, EV_ABS, ABS_Y, impl->pointer_y); + if (impl->report_x != impl->pointer_x) { + evput(impl, syn->time, EV_ABS, ABS_X, impl->pointer_x); + impl->report_x = impl->pointer_x; + } + if (impl->report_y != impl->pointer_y) { + evput(impl, syn->time, EV_ABS, ABS_Y, impl->pointer_y); + impl->report_y = impl->pointer_y; + } } } diff --git a/src/grail-impl.h b/src/grail-impl.h index 66fe4c7..af84a6c 100644 --- a/src/grail-impl.h +++ b/src/grail-impl.h @@ -32,6 +32,7 @@ struct grail_impl { int filter_abs; int pointer_status; int pointer_x, pointer_y; + int report_x, report_y; }; #endif -- cgit v1.2.3