mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-05 10:10:10 +01:00
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 <peter.hutterer@who-t.net>
This commit is contained in:
parent
c914956211
commit
acfff361a7
1 changed files with 3 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue