aboutsummaryrefslogtreecommitdiffstats
path: root/src/mtouch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mtouch.c')
-rw-r--r--src/mtouch.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mtouch.c b/src/mtouch.c
index 7272edf..14c0fd9 100644
--- a/src/mtouch.c
+++ b/src/mtouch.c
@@ -73,3 +73,11 @@ int parse_event(struct MTouch *mt, const struct input_event *ev)
#endif
return 1;
}
+
+int mt_is_idle(struct MTouch *mt, int fd)
+{
+ return mt->mem.wait &&
+ evbuf_empty(&mt->dev.outbuf) &&
+ evbuf_empty(&mt->dev.inbuf) &&
+ poll_iobuf(&mt->buf, fd, mt->mem.wait) == 0;
+}