From 65deb248e3849851943b2f5c693c7e2a2e909f69 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Thu, 30 May 2019 16:56:54 +0200 Subject: [PATCH] efl_ui_active_view_manager_*: fix bugging animation Summary: we should protect against multiple requests to the same "to" index. Otherwise either the speed could increase dramatically, or we start to oscilate arround the final position, based on the progress sign. Those ifs here are fixing it. fix T7988 Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7988 Differential Revision: https://phab.enlightenment.org/D9056 --- .../elementary/efl_ui_active_view_view_manager_scroll.c | 7 +++++++ src/lib/elementary/efl_ui_active_view_view_manager_stack.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/lib/elementary/efl_ui_active_view_view_manager_scroll.c b/src/lib/elementary/efl_ui_active_view_view_manager_scroll.c index ff185a6586..975a5df5d1 100644 --- a/src/lib/elementary/efl_ui_active_view_view_manager_scroll.c +++ b/src/lib/elementary/efl_ui_active_view_view_manager_scroll.c @@ -233,6 +233,13 @@ _page_set_animation(void *data, const Efl_Event *event EINA_UNUSED) static void _animation_request_switch(Eo *obj, Efl_Ui_Active_View_View_Manager_Scroll_Data *pd, int from, int to) { + //if there is already a transition ongoing, which is no mouse transition, but goes to the same position, then do nothing + if (pd->transition.active && !pd->mouse_move.active && pd->transition.to == to) + return; + + if (!pd->transition.active && !pd->mouse_move.active && from == to) + return; + efl_event_callback_del(pd->container, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _page_set_animation, obj); //if there is a ongoing transition, try to guess a better time, and try copy over the position where we are right now if (pd->transition.active || pd->mouse_move.active) diff --git a/src/lib/elementary/efl_ui_active_view_view_manager_stack.c b/src/lib/elementary/efl_ui_active_view_view_manager_stack.c index 65e8790d1f..ad2038a0be 100644 --- a/src/lib/elementary/efl_ui_active_view_view_manager_stack.c +++ b/src/lib/elementary/efl_ui_active_view_view_manager_stack.c @@ -182,6 +182,9 @@ _setup_anim(Efl_Animation_Player *player, Efl_Gfx_Entity *entity) EOLIAN static void _efl_ui_active_view_view_manager_stack_efl_ui_active_view_view_manager_switch_to(Eo *obj, Efl_Ui_Active_View_View_Manager_Stack_Data *pd, int from, int to) { + if (efl_pack_content_get(pd->container, to) == pd->content) + return; + if (from != -1) { if (pd->animation)