aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2018-06-28 19:56:12 +0200
committerBoris Faure <billiob@gmail.com>2018-06-28 19:56:12 +0200
commit1c4482115b11786ac6a1db6f97ec256ff4ca9886 (patch)
treef56835a0799181b645ce2a1fc4fe54f02669730b /src
parentmeson: install icons according to FDO spec. (diff)
downloadterminology-1c4482115b11786ac6a1db6f97ec256ff4ca9886.tar.gz
controls: fix frame being still shown if new controls shows up while old is not yet hidden
Thanks to camthesaxman_ for his patch (https://phab.enlightenment.org/D6360).
Diffstat (limited to 'src')
-rw-r--r--src/bin/controls.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/bin/controls.c b/src/bin/controls.c
index 834164f..911800c 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;