[PATCH libinput] libinput: litest shall only emit auto assign events when replaced

Andreas Pokorny andreas.pokorny at canonical.com
Thu Aug 20 04:43:40 PDT 2015


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 at canonical.com>
---
 test/litest.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/litest.c b/test/litest.c
index 26c5e43..8fc7bca 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -1292,7 +1292,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);
@@ -1342,8 +1341,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++;
 	}
 }
@@ -1428,7 +1427,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++;
 	}
 }
-- 
2.1.4



More information about the wayland-devel mailing list