From: Peter Hutterer Date: Mon, 9 Nov 2015 05:42:06 +0000 (+1000) Subject: tools: take the start time before initializing the context X-Git-Tag: 1.1.1~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=acfff361a7d0b7b86ccd68caede78187c1b8d474;p=platform%2Fupstream%2Flibinput.git tools: take the start time before initializing the context Otherwise events that are already queued before the first libinput_dispatch() have a negative timestamp. Signed-off-by: Peter Hutterer --- diff --git a/tools/event-debug.c b/tools/event-debug.c index 1ac00864..c6032962 100644 --- a/tools/event-debug.c +++ b/tools/event-debug.c @@ -471,6 +471,9 @@ main(int argc, char **argv) struct libinput *li; struct timespec tp; + clock_gettime(CLOCK_MONOTONIC, &tp); + start_time = tp.tv_sec * 1000 + tp.tv_nsec / 1000000; + tools_init_context(&context); if (tools_parse_args(argc, argv, &context)) @@ -480,9 +483,6 @@ main(int argc, char **argv) if (!li) return 1; - clock_gettime(CLOCK_MONOTONIC, &tp); - start_time = tp.tv_sec * 1000 + tp.tv_nsec / 1000000; - mainloop(li); libinput_unref(li);