summaryrefslogtreecommitdiff
path: root/src/bin/controls.c
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/bin/controls.c
parent6ee3c9ddd05a4a6c7dc1dfeed8c047e44fdd84b0 (diff)
controls: fix frame being still shown if new controls shows up while old is not yet hidden
Thanks to camthesaxman_ for his patch (D6360).
Diffstat (limited to 'src/bin/controls.c')
-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,
50} 50}
51 51
52static Eina_Bool 52static Eina_Bool
53_cb_del_delay(void *data) 53_cb_del(void *data)
54{ 54{
55 Evas_Object *frame = data; 55 Evas_Object *frame = data;
56 evas_object_del(frame); 56 evas_object_del(frame);
@@ -147,7 +147,8 @@ _on_sub_done(void *data)
147{ 147{
148 Controls_Ctx *ctx = data; 148 Controls_Ctx *ctx = data;
149 149
150 ecore_timer_add(10.0, _cb_del_delay, ctx->frame); 150 evas_object_event_callback_add(ctx->frame, EVAS_CALLBACK_HIDE,
151 _cb_del, ctx->frame);
151 ctx->frame = NULL; 152 ctx->frame = NULL;
152 153
153 if (ctx->donecb) 154 if (ctx->donecb)
@@ -279,15 +280,7 @@ controls_hide(Controls_Ctx *ctx, Eina_Bool call_cb)
279 280
280 if (call_cb) 281 if (call_cb)
281 { 282 {
282 ecore_timer_add(10.0, _cb_del_delay, ctx->frame); 283 _on_sub_done(ctx);
283 ctx->frame = NULL;
284
285 if (ctx->donecb)
286 ctx->donecb(ctx->donedata);
287
288 eina_hash_del(controls, &ctx->win, ctx);
289
290 free(ctx);
291 } 284 }
292} 285}
293 286
@@ -300,13 +293,13 @@ controls_show(Evas_Object *win, Evas_Object *base, Evas_Object *bg,
300 Evas_Object *ct_boxh, *ct_boxv, *ct_box, *ct_box2, *ct_box3; 293 Evas_Object *ct_boxh, *ct_boxv, *ct_box, *ct_box2, *ct_box3;
301 Controls_Ctx *ctx; 294 Controls_Ctx *ctx;
302 295
303 if (eina_hash_find(controls, &win)) 296 if (eina_hash_find(controls, &win) ||
297 edje_object_part_swallow_get(base, "terminology.controls"))
304 { 298 {
305 donecb(donedata); 299 donecb(donedata);
306 return; 300 return;
307 } 301 }
308 302
309
310 ctx = malloc(sizeof(*ctx)); 303 ctx = malloc(sizeof(*ctx));
311 assert(ctx); 304 assert(ctx);
312 ctx->win = win; 305 ctx->win = win;