From 1c4482115b11786ac6a1db6f97ec256ff4ca9886 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Thu, 28 Jun 2018 19:56:12 +0200 Subject: [PATCH] controls: fix frame being still shown if new controls shows up while old is not yet hidden Thanks to camthesaxman_ for his patch (D6360). --- src/bin/controls.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/bin/controls.c b/src/bin/controls.c index 834164fb..911800c0 100644 --- a/src/bin/controls.c +++ b/src/bin/controls.c @@ -50,7 +50,7 @@ _cb_sel_off(void *data, } static Eina_Bool -_cb_del_delay(void *data) +_cb_del(void *data) { Evas_Object *frame = data; evas_object_del(frame); @@ -147,7 +147,8 @@ _on_sub_done(void *data) { Controls_Ctx *ctx = data; - ecore_timer_add(10.0, _cb_del_delay, ctx->frame); + evas_object_event_callback_add(ctx->frame, EVAS_CALLBACK_HIDE, + _cb_del, ctx->frame); ctx->frame = NULL; if (ctx->donecb) @@ -279,15 +280,7 @@ controls_hide(Controls_Ctx *ctx, Eina_Bool call_cb) if (call_cb) { - ecore_timer_add(10.0, _cb_del_delay, ctx->frame); - ctx->frame = NULL; - - if (ctx->donecb) - ctx->donecb(ctx->donedata); - - eina_hash_del(controls, &ctx->win, ctx); - - free(ctx); + _on_sub_done(ctx); } } @@ -300,13 +293,13 @@ controls_show(Evas_Object *win, Evas_Object *base, Evas_Object *bg, Evas_Object *ct_boxh, *ct_boxv, *ct_box, *ct_box2, *ct_box3; Controls_Ctx *ctx; - if (eina_hash_find(controls, &win)) + if (eina_hash_find(controls, &win) || + edje_object_part_swallow_get(base, "terminology.controls")) { donecb(donedata); return; } - ctx = malloc(sizeof(*ctx)); assert(ctx); ctx->win = win;