diff --git a/lisgd.c b/lisgd.c index e3a1c1c..9d3442b 100644 --- a/lisgd.c +++ b/lisgd.c @@ -169,6 +169,7 @@ touchup(struct libinput_event *e) void run() { + int i; struct libinput *li; struct libinput_event *event; struct libinput_event_touch *tevent; @@ -191,6 +192,14 @@ run() die("Couldn't set mode to capture events\n"); } + // E.g. initially invalidate every slot + for (i = 0; i < MAXSLOTS; i++) { + xend[i] = INVALID; + yend[i] = INVALID; + xstart[i] = INVALID; + ystart[i] = INVALID; + } + FD_ZERO(&fdset); FD_SET(libinput_get_fd(li), &fdset); for (;;) {