[PATCH weston 3/3] eventdemo: do not print axis events if not requested

Pekka Paalanen ppaalanen at gmail.com
Tue May 10 14:11:41 UTC 2016


From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
 clients/eventdemo.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/clients/eventdemo.c b/clients/eventdemo.c
index 38eb904..64b3d01 100644
--- a/clients/eventdemo.c
+++ b/clients/eventdemo.c
@@ -288,6 +288,9 @@ axis_source_handler(struct widget *widget, struct input *input,
 	const char *axis_source;
 	struct eventdemo *e = data;
 
+	if (!log_axis)
+		return;
+
 	e->print_pointer_frame = true;
 
 	switch (source) {
@@ -315,6 +318,9 @@ axis_stop_handler(struct widget *widget, struct input *input,
 {
 	struct eventdemo *e = data;
 
+	if (!log_axis)
+		return;
+
 	e->print_pointer_frame = true;
 	printf("axis stop time: %d, axis: %s\n",
 	       time,
@@ -328,6 +334,9 @@ axis_discrete_handler(struct widget *widget, struct input *input,
 {
 	struct eventdemo *e = data;
 
+	if (!log_axis)
+		return;
+
 	e->print_pointer_frame = true;
 	printf("axis discrete axis: %d value: %d\n", axis, discrete);
 }
-- 
2.7.3



More information about the wayland-devel mailing list