tools/record: fix indentation for libinput events

Commit 0cdf459643
  tools/record: get rid of indent push/pop, replace with fixed indents

Introduced some magic to detect if there's a '-' at the start of the
format string to fix the identation. This only works if the format
string is constant though, leading to an indentation error when record
is run with --with-libinput.

Fixes 0cdf459643

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2022-05-06 13:44:58 +10:00
parent f22d193879
commit 200bc920ac

View file

@ -1291,7 +1291,10 @@ handle_libinput_events(struct record_context *ctx,
if (!e)
return false;
iprintf(d->fp, I_EVENTTYPE, "%slibinput:\n", start_frame ? "- " : "");
if (start_frame)
iprintf(d->fp, I_EVENTTYPE, "- libinput:\n");
else
iprintf(d->fp, I_EVENTTYPE, "libinput:\n");
do {
struct libinput_device *device = libinput_event_get_device(e);