libinput: litest shall only emit auto assign events when replaced

With this change auto assign events will be skipped if no replacement value
is provided. This behavior is practical when emitting mt events, as those
only contain the axis values that changed.

Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Andreas Pokorny 2015-08-20 13:43:40 +02:00 committed by Peter Hutterer
parent 8215d725d0
commit 58f25a47ed

View file

@ -1294,7 +1294,6 @@ litest_auto_assign_value(struct litest_device *d,
value = touching ? 0 : 1;
break;
default:
value = -1;
if (!axis_replacement_value(axes, ev->code, &value) &&
d->interface->get_axis_default)
d->interface->get_axis_default(d, ev->code, &value);
@ -1344,8 +1343,8 @@ litest_slot_start(struct litest_device *d,
y,
axes,
touching);
litest_event(d, ev->type, ev->code, value);
if (value != LITEST_AUTO_ASSIGN)
litest_event(d, ev->type, ev->code, value);
ev++;
}
}
@ -1430,7 +1429,8 @@ litest_slot_move(struct litest_device *d,
y,
axes,
touching);
litest_event(d, ev->type, ev->code, value);
if (value != LITEST_AUTO_ASSIGN)
litest_event(d, ev->type, ev->code, value);
ev++;
}
}