[PATCH libinput 2/6] Correct documentation on get_slot and get_seat_slot()
Peter Hutterer
peter.hutterer at who-t.net
Thu Mar 12 17:37:46 PDT 2015
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 <peter.hutterer at who-t.net>
---
src/libinput.h | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/libinput.h b/src/libinput.h
index 9a7829e..f978b37 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
*/
--
2.1.0
More information about the wayland-devel
mailing list