From 1447f1e3ede407c1e8162117c5b2534b40fa9aa4 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 13 Mar 2015 09:50:07 +1000 Subject: [PATCH] Correct documentation on get_slot and get_seat_slot() We don't actually use TOUCH_CANCEL in libinput, but either way calling the slot on a cancel should be valid. Calling it on a FRAME event is not. Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede --- src/libinput.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/libinput.h b/src/libinput.h index 9a7829ea..f978b37f 100644 --- a/src/libinput.h +++ b/src/libinput.h @@ -797,8 +797,13 @@ libinput_event_touch_get_time(struct libinput_event_touch *event); * If the touch event has no assigned slot, for example if it is from a * single touch device, this function returns -1. * - * @note this function should not be called for @ref - * LIBINPUT_EVENT_TOUCH_CANCEL or @ref LIBINPUT_EVENT_TOUCH_FRAME. + * For events not of type @ref LIBINPUT_EVENT_TOUCH_DOWN, @ref + * LIBINPUT_EVENT_TOUCH_UP, @ref LIBINPUT_EVENT_TOUCH_MOTION or @ref + * LIBINPUT_EVENT_TOUCH_CANCEL, this function returns 0. + * + * @note It is an application bug to call this function for events of type + * other than @ref LIBINPUT_EVENT_TOUCH_DOWN, @ref LIBINPUT_EVENT_TOUCH_UP, + * @ref LIBINPUT_EVENT_TOUCH_MOTION or @ref LIBINPUT_EVENT_TOUCH_CANCEL. * * @return The slot of this touch event */ @@ -814,8 +819,13 @@ libinput_event_touch_get_slot(struct libinput_event_touch *event); * Events from single touch devices will be represented as one individual * touch point per device. * - * @note this function should not be called for @ref - * LIBINPUT_EVENT_TOUCH_CANCEL or @ref LIBINPUT_EVENT_TOUCH_FRAME. + * For events not of type @ref LIBINPUT_EVENT_TOUCH_DOWN, @ref + * LIBINPUT_EVENT_TOUCH_UP, @ref LIBINPUT_EVENT_TOUCH_MOTION or @ref + * LIBINPUT_EVENT_TOUCH_CANCEL, this function returns 0. + * + * @note It is an application bug to call this function for events of type + * other than @ref LIBINPUT_EVENT_TOUCH_DOWN, @ref LIBINPUT_EVENT_TOUCH_UP, + * @ref LIBINPUT_EVENT_TOUCH_MOTION or @ref LIBINPUT_EVENT_TOUCH_CANCEL. * * @return The seat slot of the touch event */