From 847ce345972d735cad81faaf762ec482e83c4036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 30 Dec 2013 22:08:35 +0100 Subject: [PATCH] Don't return error when dispatching didn't queue any event MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As reading from timers or evdev does not necessarily mean an input event is queued and ready to be retrieved with libinput_get_event(), don't report such behaviour as an error. Signed-off-by: Jonas Ã…dahl --- src/libinput.c | 2 +- src/libinput.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libinput.c b/src/libinput.c index 1019e3cc..d653f84b 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -560,7 +560,7 @@ libinput_dispatch(struct libinput *libinput) free(source); list_init(&libinput->source_destroy_list); - return libinput->events_count > 0 ? 0 : -EAGAIN; + return 0; } static void diff --git a/src/libinput.h b/src/libinput.h index cd10b979..b92b2063 100644 --- a/src/libinput.h +++ b/src/libinput.h @@ -466,11 +466,11 @@ libinput_get_fd(struct libinput *libinput); * and processes them internally. Use libinput_get_event() to retrieve the * events. * + * Dispatching does not necessarily queue libinput events. + * * @param libinput A previously initialized libinput context * * @return 0 on success, or a negative errno on failure - * @retval -EAGAIN libinput_dispatch completed successfully but no events - * are ready to read with libinput_get_event() */ int libinput_dispatch(struct libinput *libinput);