billiob pushed a commit to branch terminology-1.2.

http://git.enlightenment.org/apps/terminology.git/commit/?id=1c4482115b11786ac6a1db6f97ec256ff4ca9886

commit 1c4482115b11786ac6a1db6f97ec256ff4ca9886
Author: Boris Faure <[email protected]>
Date:   Thu Jun 28 19:56:12 2018 +0200

    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 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;

-- 


Reply via email to