From 4f28e49f467cd5e94b77d607ed0f3e95fc3fc6dc Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 12 Sep 2017 13:21:09 -0400 Subject: [PATCH] handle shade <-> unshade toggling in same frame this should result in a no-op instead of a fail-op fix T6006 --- src/bin/e_comp_object.c | 50 +++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c index 1dc282922..0b2f9856c 100644 --- a/src/bin/e_comp_object.c +++ b/src/bin/e_comp_object.c @@ -2117,22 +2117,6 @@ _e_comp_object_shade_animator(void *data) return cw->ec->shading; } -static void -_e_comp_smart_cb_shading(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) -{ - E_Comp_Object *cw = data; - - if (!cw->ec) return; //NYI - E_FREE_FUNC(cw->shade.anim, ecore_animator_del); - - cw->shade.x = cw->x; - cw->shade.y = cw->y; - e_comp_object_signal_emit(cw->smart_obj, "e,state,shading", "e"); - cw->shade.start = ecore_loop_time_get(); - cw->shade.dir = (E_Direction)event_info; - cw->shade.anim = ecore_animator_add(_e_comp_object_shade_animator, cw); -} - static void _e_comp_smart_cb_shaded(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) { @@ -2148,16 +2132,24 @@ _e_comp_smart_cb_shaded(void *data, Evas_Object *obj EINA_UNUSED, void *event_in } static void -_e_comp_smart_cb_unshading(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) +_e_comp_smart_cb_shading(void *data, Evas_Object *obj, void *event_info) { E_Comp_Object *cw = data; if (!cw->ec) return; //NYI + if (cw->shade.anim && EINA_DBL_EQ(cw->shade.val, 0.0)) + { + cw->ec->shaded = 0; + _e_comp_smart_cb_shaded(data, obj, event_info); + return; + } E_FREE_FUNC(cw->shade.anim, ecore_animator_del); - cw->shade.dir = (E_Direction)event_info; - e_comp_object_signal_emit(cw->smart_obj, "e,state,unshading", "e"); + cw->shade.x = cw->x; + cw->shade.y = cw->y; + e_comp_object_signal_emit(cw->smart_obj, "e,state,shading", "e"); cw->shade.start = ecore_loop_time_get(); + cw->shade.dir = (E_Direction)event_info; cw->shade.anim = ecore_animator_add(_e_comp_object_shade_animator, cw); } @@ -2186,6 +2178,26 @@ _e_comp_smart_cb_unshaded(void *data, Evas_Object *obj EINA_UNUSED, void *event_ _e_comp_object_shade_animator(cw); } +static void +_e_comp_smart_cb_unshading(void *data, Evas_Object *obj, void *event_info) +{ + E_Comp_Object *cw = data; + + if (!cw->ec) return; //NYI + if (cw->shade.anim && EINA_DBL_EQ(cw->shade.val, 0.0)) + { + cw->ec->shaded = 1; + _e_comp_smart_cb_unshaded(data, obj, event_info); + return; + } + E_FREE_FUNC(cw->shade.anim, ecore_animator_del); + + cw->shade.dir = (E_Direction)event_info; + e_comp_object_signal_emit(cw->smart_obj, "e,state,unshading", "e"); + cw->shade.start = ecore_loop_time_get(); + cw->shade.anim = ecore_animator_add(_e_comp_object_shade_animator, cw); +} + static void _e_comp_smart_cb_maximize(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) {