controls: fix frame being still shown if new controls shows up while old is not yet hidden

Thanks to camthesaxman_ for his patch (D6360).
This commit is contained in:
Boris Faure 2018-06-28 19:56:12 +02:00
parent 6ee3c9ddd0
commit 1c4482115b
1 changed files with 6 additions and 13 deletions

View File

@ -50,7 +50,7 @@ _cb_sel_off(void *data,
} }
static Eina_Bool static Eina_Bool
_cb_del_delay(void *data) _cb_del(void *data)
{ {
Evas_Object *frame = data; Evas_Object *frame = data;
evas_object_del(frame); evas_object_del(frame);
@ -147,7 +147,8 @@ _on_sub_done(void *data)
{ {
Controls_Ctx *ctx = 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; ctx->frame = NULL;
if (ctx->donecb) if (ctx->donecb)
@ -279,15 +280,7 @@ controls_hide(Controls_Ctx *ctx, Eina_Bool call_cb)
if (call_cb) if (call_cb)
{ {
ecore_timer_add(10.0, _cb_del_delay, ctx->frame); _on_sub_done(ctx);
ctx->frame = NULL;
if (ctx->donecb)
ctx->donecb(ctx->donedata);
eina_hash_del(controls, &ctx->win, ctx);
free(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; Evas_Object *ct_boxh, *ct_boxv, *ct_box, *ct_box2, *ct_box3;
Controls_Ctx *ctx; 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); donecb(donedata);
return; return;
} }
ctx = malloc(sizeof(*ctx)); ctx = malloc(sizeof(*ctx));
assert(ctx); assert(ctx);
ctx->win = win; ctx->win = win;