Suppress out of range warning messages
If touchpad firmware does not report correct boundaries of touchpad
surface, the library keeps printing out warning messages in Xorg.0.log
once a finger is on the 'out of range' position. The patch tries to
suppress this kind of messages by updating effective boundary of X/Y
axis once the reported event is out of current range.
BUG=chromium-os:16477
TEST=on device; move a finger around the boundaries of the touchpad
and see if the warning messages should be suppressed by updating
X and Y ranges
Change-Id: I90e94fbf51c22f3e918aa29c3170b6481cf46d15
Reviewed-on: https://gerrit.chromium.org/gerrit/40427
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Commit-Queue: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
diff --git a/src/libevdev_event.c b/src/libevdev_event.c
index c70baa0..05035e6 100644
--- a/src/libevdev_event.c
+++ b/src/libevdev_event.c
@@ -620,6 +620,11 @@
|| (ev->value > axis->maximum))) {
LOG_WARNING(device, "ABS_MT[%02x] = %d : value out of range [%d .. %d]\n",
ev->code, ev->value, axis->minimum, axis->maximum);
+ /* Update the effective boundary as we already print out the warning */
+ if (ev->value < axis->minimum)
+ axis->minimum = ev->value;
+ else if (ev->value > axis->maximum)
+ axis->maximum = ev->value;
}
if (slot == NULL) {