cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=91ba12fed938281048586c7127370e41689a8eff

commit 91ba12fed938281048586c7127370e41689a8eff
Author: jiin.moon <jiin.m...@samsung.com>
Date:   Wed Dec 2 14:22:35 2015 -0800

    ecore_evas: fix disappearing socket image
    
    Summary:
    In case there is connection between a server and some client,
    show/hide does not work properly.
    
    If there are clients need to show,
    this patch make it hide operation will not work even if get the hide signal
    
    @fix
    
    Reviewers: jypark, Hermet, cedric
    
    Subscribers: Hermet, cedric
    
    Differential Revision: https://phab.enlightenment.org/D2962
    
    Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/modules/ecore_evas/engines/extn/ecore_evas_extn.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c 
b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
index e280bbc..c04afe8 100644
--- a/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
+++ b/src/modules/ecore_evas/engines/extn/ecore_evas_extn.c
@@ -27,7 +27,6 @@
 static int blank = 0x00000000;
 static const char *interface_extn_name = "extn";
 static const int   interface_extn_version = 1;
-
 static Ecore_Evas_Interface_Extn *_ecore_evas_extn_interface_new(void);
 static void *_ecore_evas_socket_switch(void *data, void *dest_buf);
 
@@ -38,6 +37,7 @@ struct _Extn
    struct {
       Ecore_Ipc_Server *server;
       Eina_List *clients;
+      Eina_List *visible_clients;
       Eina_List *handlers;
    } ipc;
    struct {
@@ -208,6 +208,7 @@ _ecore_evas_extn_free(Ecore_Evas *ee)
                ecore_ipc_client_del(client);
           }
         if (extn->ipc.server) ecore_ipc_server_del(extn->ipc.server);
+        if (extn->ipc.visible_clients) 
eina_list_free(extn->ipc.visible_clients);
 
         EINA_LIST_FREE(extn->file.updates, ipc)
           free(ipc);
@@ -1594,6 +1595,7 @@ _ipc_client_del(void *data, int type EINA_UNUSED, void 
*event)
    if (!eina_list_data_find(extn->ipc.clients, e->client)) return 
ECORE_CALLBACK_PASS_ON;
 
    extn->ipc.clients = eina_list_remove(extn->ipc.clients, e->client);
+   extn->ipc.visible_clients = eina_list_remove(extn->ipc.visible_clients, 
e->client);
 
    _ecore_evas_extn_event(ee, ECORE_EVAS_EXTN_CLIENT_DEL);
    return ECORE_CALLBACK_PASS_ON;
@@ -1629,6 +1631,8 @@ _ipc_client_data(void *data, int type EINA_UNUSED, void 
*event)
       case OP_SHOW:
          if (!ee->visible)
            {
+              if (!eina_list_data_find(extn->ipc.visible_clients, e->client))
+                extn->ipc.visible_clients = 
eina_list_append(extn->ipc.visible_clients, e->client);
               ee->prop.withdrawn = EINA_FALSE;
               if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
               ee->visible = 1;
@@ -1638,10 +1642,14 @@ _ipc_client_data(void *data, int type EINA_UNUSED, void 
*event)
       case OP_HIDE:
          if (ee->visible)
            {
-              ee->prop.withdrawn = EINA_TRUE;
-              if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
-              ee->visible = 0;
-              if (ee->func.fn_hide) ee->func.fn_hide(ee);
+              extn->ipc.visible_clients = 
eina_list_remove(extn->ipc.visible_clients, e->client);
+              if (!eina_list_count(extn->ipc.visible_clients))
+                {
+                   ee->prop.withdrawn = EINA_TRUE;
+                   if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
+                   ee->visible = 0;
+                   if (ee->func.fn_hide) ee->func.fn_hide(ee);
+                }
            }
          break;
       case OP_FOCUS:

-- 


Reply via email to