From 07980c13df99179d3e3563a603ed0ec5d791bd38 Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 8 Oct 2021 17:49:43 -0400 Subject: [PATCH] [input] set id to -1 if returning error --- src/lib/in.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/in.c b/src/lib/in.c index 675941997..aaeb8d49a 100644 --- a/src/lib/in.c +++ b/src/lib/in.c @@ -1972,7 +1972,13 @@ delaybound_to_deadline(const struct timespec* ts, struct timespec* absdl){ uint32_t notcurses_get(notcurses* nc, const struct timespec* ts, ncinput* ni){ struct timespec absdl; delaybound_to_deadline(ts, &absdl); - return internal_get(nc->tcache.ictx, ts ? &absdl : NULL, ni); + uint32_t id = internal_get(nc->tcache.ictx, ts ? &absdl : NULL, ni); + if(ni){ + if(id == (uint32_t)-1){ + ni->id = id; + } + } + return id; } // FIXME better performance if we move this within the locked area