diff options
author | Chris Michael <cp.michael@samsung.com> | 2014-10-16 12:18:50 -0400 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2014-10-16 12:18:50 -0400 |
commit | 4b251d783cb4f4b1517d47f82bcaf4475febda2c (patch) | |
tree | f331a2a9760a9091ce185704e178cc605101dcd6 | |
parent | 3f2b22871589a0536ede3bc117e9e16e9696499f (diff) | |
download | enlightenment-4b251d783cb4f4b1517d47f82bcaf4475febda2c.tar.gz |
add listener for comp_object_add event so we can setup evas callbacks
for a client.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r-- | src/bin/e_comp_wl.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 26f5bc1d9e..c3df52221c 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -15,6 +15,7 @@ /* local variables */ static Eina_Hash *clients_win_hash = NULL; +static Eina_List *handlers = NULL; /* local functions */ static void @@ -75,6 +76,35 @@ _e_comp_wl_cb_module_idle(void *data) } static void +_e_comp_wl_client_evas_init(E_Client *ec) +{ + ec->comp_data->evas_init = EINA_TRUE; +} + +static Eina_Bool +_e_comp_wl_cb_comp_object_add(void *data EINA_UNUSED, int type EINA_UNUSED, E_Event_Comp_Object *ev) +{ + E_Client *ec; + + /* try to get the client from the object */ + if (!(ec = e_comp_object_client_get(ev->comp_object))) + return ECORE_CALLBACK_RENEW; + + /* check for client being deleted */ + if (e_object_is_del(E_OBJECT(ec))) return ECORE_CALLBACK_RENEW; + + /* check for wayland pixmap */ + E_COMP_WL_PIXMAP_CHECK ECORE_CALLBACK_RENEW; + + DBG("Comp Object Added For Pixmap: %llu", e_pixmap_window_get(ec->pixmap)); + + /* if we have not setup evas callbacks for this client, do it */ + if (!ec->comp_data->evas_init) _e_comp_wl_client_evas_init(ec); + + return ECORE_CALLBACK_RENEW; +} + +static void _e_comp_wl_buffer_cb_destroy(struct wl_listener *listener, void *data EINA_UNUSED) { E_Comp_Wl_Buffer *buffer; @@ -877,6 +907,10 @@ e_comp_wl_init(void) /* create hash to store clients */ clients_win_hash = eina_hash_int64_new(NULL); + /* add event handlers to catch E events */ + E_LIST_HANDLER_APPEND(handlers, E_EVENT_COMP_OBJECT_ADD, + _e_comp_wl_cb_comp_object_add, NULL); + /* add hooks to catch e_client events */ e_client_hook_add(E_CLIENT_HOOK_NEW_CLIENT, _e_comp_wl_client_cb_new, NULL); e_client_hook_add(E_CLIENT_HOOK_DEL, _e_comp_wl_client_cb_del, NULL); @@ -894,6 +928,9 @@ e_comp_wl_surface_create_signal_get(E_Comp *comp) EINTERN void e_comp_wl_shutdown(void) { + /* free handlers */ + E_FREE_LIST(handlers, ecore_event_handler_del); + /* free the clients win hash */ E_FREE_FUNC(clients_win_hash, eina_hash_free); |