From 56d31f30b7f6d62e4502f2001af360e1bf6edffe Mon Sep 17 00:00:00 2001 From: "se.osadchy" Date: Tue, 7 Feb 2017 13:37:11 -0800 Subject: [PATCH] elm gesture layer: add check for negative input tap start timeout. Summary: Add set 0 as start timeout if negative input value. @fix Reviewers: cedric, Hermet, raster Subscribers: jpeg Differential Revision: https://phab.enlightenment.org/D4625 Signed-off-by: Cedric BAIL --- src/lib/elementary/elm_gesture_layer.c | 4 ++-- src/lib/elementary/elm_gesture_layer_common.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/elementary/elm_gesture_layer.c b/src/lib/elementary/elm_gesture_layer.c index 39db639..b08dcb1 100644 --- a/src/lib/elementary/elm_gesture_layer.c +++ b/src/lib/elementary/elm_gesture_layer.c @@ -4095,7 +4095,7 @@ elm_gesture_layer_long_tap_start_timeout_set(Evas_Object *obj, double long_tap_s { ELM_GESTURE_LAYER_CHECK(obj); ELM_GESTURE_LAYER_DATA_GET(obj, sd); - sd->long_tap_start_timeout = long_tap_start_timeout; + sd->long_tap_start_timeout = ((long_tap_start_timeout > 0) ? long_tap_start_timeout : 0); } EAPI double @@ -4127,7 +4127,7 @@ elm_gesture_layer_double_tap_timeout_set(Evas_Object *obj, double double_tap_tim { ELM_GESTURE_LAYER_CHECK(obj); ELM_GESTURE_LAYER_DATA_GET(obj, sd); - sd->double_tap_timeout = double_tap_timeout; + sd->double_tap_timeout = ((double_tap_timeout > 0) ? double_tap_timeout : 0); } EAPI double diff --git a/src/lib/elementary/elm_gesture_layer_common.h b/src/lib/elementary/elm_gesture_layer_common.h index cf9f23b..bb061f3 100644 --- a/src/lib/elementary/elm_gesture_layer_common.h +++ b/src/lib/elementary/elm_gesture_layer_common.h @@ -288,7 +288,8 @@ EAPI unsigned int elm_gesture_layer_flick_time_limit_ms_get(const Evas_Object *o /** * This function sets the gesture layer long tap start timeout of an object * - * Recognize as a long tap when a tab occurs over @c long_tap_start_timeout. + * Recognize as a long tap when a tab occurs over @c long_tap_start_timeout, + * if set negative value, timeout will be 0. * * @param obj gesture-layer. * @param long_tap_start_timeout long tap start timeout @@ -333,7 +334,7 @@ EAPI Eina_Bool elm_gesture_layer_continues_enable_get(const Evas_Object *obj); * This function sets the gesture layer double tap timeout of an object * * When the time diffrence between two tabs is less than the @c double_tap_timeout value, - * it is recognized as a double tab. + * it is recognized as a double tab, if set negative value, timeout will be 0. * * @param obj gesture-layer. * @param double_tap_timeout double tap timeout -- 2.7.4