Question
I'm trying to implement flick gesture handling in my Tizen native application by following the guide at: https://developer.tizen.org/ko/development/guides/native-application/user-interface/efl/event-handling/handling-touch-gestures?langswitch=ko
The implementation works, but there's a noticeable delay before the flick event callback is triggered. The callback only starts working after some time has passed. Here's my current implementation:
Evas_Object* pImgScroller = AddScroller();
Evas_Object* pImgScrollerBox = elm_box_add(pImgScroller);
Evas_Object* pGestureLayer = elm_gesture_layer_add(pImgScrollerBox);
if(pGestureLayer) {
elm_gesture_layer_attach(pGestureLayer, pImgScrollerBox);
elm_gesture_layer_flick_time_limit_ms_set(pGestureLayer, 1000);
elm_gesture_layer_cb_set(pGestureLayer, ELM_GESTURE_N_FLICKS, ELM_GESTURE_STATE_END, flick_end, pImgScroller);
}
// Callback function
static Evas_Event_Flags flick_end(void *data, void *event_info) {
MINTLOG("[PBJ] Flick");
}
Is there any way to eliminate this initial delay or at least detect when the registration is complete? Any help would be appreciated.
Answer
Problem Understanding
The user is experiencing a delay between gesture layer initialization and when the flick event callback becomes active. This delay affects the responsiveness of the application.
Solution Methods
-
Check Event Sequence: Ensure the gesture layer is properly attached before expecting callbacks. The delay might be due to the system waiting for the complete touch sequence (down-move-up).
-
Adjust Time Threshold: Modify the flick time limit to see if it affects the responsiveness:
elm_gesture_layer_flick_time_limit_ms_set(pGestureLayer, 500); // Try reducing from 1000ms -
Verify Callback Registration: Add logging to confirm when the callback is actually registered:
if (elm_gesture_layer_cb_set(pGestureLayer, ELM_GESTURE_N_FLICKS, ELM_GESTURE_STATE_END, flick_end, pImgScroller)) { MINTLOG("Flick callback registered successfully"); }
Additional Tips
- Make sure the gesture layer has proper dimensions and is actually receiving touch events
- Consider using
ELM_GESTURE_STATE_MOVEin addition toELM_GESTURE_STATE_ENDfor more immediate feedback - Check if other gesture callbacks (like tap or long tap) are responding faster, which might indicate a flick-specific issue