discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=bd776b157fcba6c3634e36802fe94eae266bb49b

commit bd776b157fcba6c3634e36802fe94eae266bb49b
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Fri Jul 17 15:29:13 2015 -0400

    add e_client_unignore() for triggering events when unignoring a client
    
    mainly for use in wayland compositing since all surfaces are ignored
    until they get a shell surface or a commit
---
 src/bin/e_client.c                        | 14 +++++++++++++-
 src/bin/e_client.h                        |  1 +
 src/bin/e_comp_x.c                        |  3 ++-
 src/bin/e_deskmirror.c                    |  9 +++++++++
 src/modules/wl_desktop_shell/e_mod_main.c |  6 +++---
 5 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index d7eb573..1722d56 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -2453,6 +2453,17 @@ e_client_shutdown(void)
    warp_client = NULL;
 }
 
+E_API void
+e_client_unignore(E_Client *ec)
+{
+   E_OBJECT_CHECK(ec);
+   E_OBJECT_TYPE_CHECK(ec, E_CLIENT_TYPE);
+   if (!ec->ignored) return;
+
+   ec->ignored = 0;
+   _e_client_event_simple(ec, E_EVENT_CLIENT_ADD);
+}
+
 E_API E_Client *
 e_client_new(E_Pixmap *cp, int first_map, int internal)
 {
@@ -2555,7 +2566,8 @@ e_client_new(E_Pixmap *cp, int first_map, int internal)
    e_comp->clients = eina_list_append(e_comp->clients, ec);
    eina_hash_add(clients_hash[e_pixmap_type_get(cp)], &ec->pixmap, ec);
 
-   _e_client_event_simple(ec, E_EVENT_CLIENT_ADD);
+   if (!ec->ignored)
+     _e_client_event_simple(ec, E_EVENT_CLIENT_ADD);
    e_comp_object_client_add(ec);
    if (ec->frame)
      {
diff --git a/src/bin/e_client.h b/src/bin/e_client.h
index 5ef068f..14427b9 100644
--- a/src/bin/e_client.h
+++ b/src/bin/e_client.h
@@ -748,6 +748,7 @@ EINTERN void e_client_idler_before(void);
 EINTERN Eina_Bool e_client_init(void);
 EINTERN void e_client_shutdown(void);
 E_API E_Client *e_client_new(E_Pixmap *cp, int first_map, int internal);
+E_API void e_client_unignore(E_Client *ec);
 E_API void e_client_desk_set(E_Client *ec, E_Desk *desk);
 E_API Eina_Bool e_client_comp_grabbed_get(void);
 E_API E_Client *e_client_action_get(void);
diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c
index 9cdb73f..6041b0b 100644
--- a/src/bin/e_comp_x.c
+++ b/src/bin/e_comp_x.c
@@ -5433,7 +5433,8 @@ e_comp_x_xwayland_client_setup(E_Client *ec, E_Client *wc)
    if (pwin)
      eina_hash_set(clients_win_hash, &pwin, wc);
    wc->visible = 1;
-   wc->ignored = 0;
+   if (wc->ignored)
+     e_client_unignore(wc);
    if (ec->override)
      e_client_focus_stack_set(eina_list_remove(e_client_focus_stack_get(), 
wc));
    evas_object_name_set(wc->frame, evas_object_name_get(ec->frame));
diff --git a/src/bin/e_deskmirror.c b/src/bin/e_deskmirror.c
index 7e5c4e6..59dea8a 100644
--- a/src/bin/e_deskmirror.c
+++ b/src/bin/e_deskmirror.c
@@ -661,6 +661,14 @@ _comp_object_add(E_Smart_Data *sd, int type EINA_UNUSED, 
E_Event_Comp_Object *ev
 }
 
 static Eina_Bool
+_client_add(E_Smart_Data *sd, int type EINA_UNUSED, E_Event_Client *ev)
+{
+   if (!eina_hash_find(sd->mirror_hash, &ev->ec->frame))
+     _e_deskmirror_mirror_add(sd, ev->ec->frame);
+   return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool
 _client_desk_set(E_Smart_Data *sd, int type EINA_UNUSED, 
E_Event_Client_Desk_Set *ev)
 {
    Mirror *m;
@@ -745,6 +753,7 @@ e_deskmirror_add(E_Desk *desk, Eina_Bool pager, Eina_Bool 
taskbar)
    e_layout_thaw(sd->layout);
 
    E_LIST_HANDLER_APPEND(sd->handlers, E_EVENT_COMP_OBJECT_ADD, 
(Ecore_Event_Handler_Cb)_comp_object_add, sd);
+   E_LIST_HANDLER_APPEND(sd->handlers, E_EVENT_CLIENT_ADD, 
(Ecore_Event_Handler_Cb)_client_add, sd);
    E_LIST_HANDLER_APPEND(sd->handlers, E_EVENT_CLIENT_PROPERTY, 
(Ecore_Event_Handler_Cb)_client_property, sd);
    E_LIST_HANDLER_APPEND(sd->handlers, E_EVENT_CLIENT_DESK_SET, 
(Ecore_Event_Handler_Cb)_client_desk_set, sd);
    return o;
diff --git a/src/modules/wl_desktop_shell/e_mod_main.c 
b/src/modules/wl_desktop_shell/e_mod_main.c
index 0a23394..83d5558 100644
--- a/src/modules/wl_desktop_shell/e_mod_main.c
+++ b/src/modules/wl_desktop_shell/e_mod_main.c
@@ -540,7 +540,7 @@ _e_shell_cb_shell_surface_get(struct wl_client *client, 
struct wl_resource *reso
    EC_CHANGED(ec);
    ec->new_client = ec->netwm.ping = EINA_TRUE;
    e_comp->new_clients++;
-   ec->ignored = 0;
+   e_client_unignore(ec);
 
    /* get the client data */
    if (!(cdata = ec->comp_data))
@@ -1088,7 +1088,7 @@ _e_xdg_shell_cb_surface_get(struct wl_client *client, 
struct wl_resource *resour
    EC_CHANGED(ec);
    ec->new_client = ec->netwm.ping = EINA_TRUE;
    e_comp->new_clients++;
-   ec->ignored = 0;
+   e_client_unignore(ec);
 
    /* get the client data */
    if (!(cdata = ec->comp_data))
@@ -1216,7 +1216,7 @@ _e_xdg_shell_cb_popup_get(struct wl_client *client, 
struct wl_resource *resource
 
    EC_CHANGED(ec);
    ec->new_client = ec->override = 1;
-   ec->ignored = 0;
+   e_client_unignore(ec);
    e_comp->new_clients++;
    e_client_focus_stack_set(eina_list_remove(e_client_focus_stack_get(), ec));
    if (!ec->internal)

-- 


Reply via email to