diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2018-03-09 14:50:56 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2018-03-09 14:56:02 +1000 |
commit | 12410dfba4b903108c8926d68c64ed1c7468902d (patch) | |
tree | aa7c71884814a7d496f5cf824cc7b76f5c9599ed /tools/libinput-record.c | |
parent | a6d03c9c8fee51cf0076c4a82f7f10c32360d6d5 (diff) |
tools: libinput-record: fix frame printing for multiple devices
The evdev events were just dumped into one big list instead of being split up
by frame.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools/libinput-record.c')
-rw-r--r-- | tools/libinput-record.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/tools/libinput-record.c b/tools/libinput-record.c index b0f11e8b..9c45db91 100644 --- a/tools/libinput-record.c +++ b/tools/libinput-record.c @@ -218,13 +218,23 @@ print_evdev_event(struct record_context *ctx, struct input_event *ev) static inline void print_evdev_events(struct record_context *ctx, struct input_event *e, size_t nevents) { - iprintf(ctx, "- evdev:\n"); - indent_push(ctx); + bool have_ev_syn = true; + - for (size_t i = 0; i < nevents; i++) + for (size_t i = 0; i < nevents; i++) { + if (have_ev_syn) { + iprintf(ctx, "- evdev:\n"); + indent_push(ctx); + have_ev_syn = false; + } print_evdev_event(ctx, &e[i]); - indent_pop(ctx); + if (e[i].type == EV_SYN && e[i].code == SYN_REPORT) { + have_ev_syn = true; + indent_pop(ctx); + } + } + } static inline size_t |