summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-10-15 08:01:14 -0400
committerChris Michael <cp.michael@samsung.com>2014-10-15 08:01:14 -0400
commit76e1c8e953ccf71fd063bdc2ba24119a0bde4b48 (patch)
treec3551d6f5556cf0b399a2a4ecc3bee9d142659b7
parentda2049b052be16974283005019cd20202a341bcf (diff)
downloadenlightenment-76e1c8e953ccf71fd063bdc2ba24119a0bde4b48.tar.gz
add code to hook the client new event
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/bin/e_comp_wl.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 35be654e22..03d54bd405 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -386,6 +386,63 @@ _e_comp_wl_compositor_cb_del(E_Comp *comp)
free(cdata);
}
+static void
+_e_comp_wl_client_cb_new(void *data EINA_UNUSED, E_Client *ec)
+{
+ uint64_t win;
+
+ DBG("Comp Hook Client New");
+
+ /* make sure this is a wayland client */
+ E_COMP_WL_PIXMAP_CHECK;
+
+ /* get window id from pixmap */
+ win = e_pixmap_window_get(ec->pixmap);
+
+ /* ignore fake root windows */
+ if ((ec->override) && ((ec->x == -77) && (ec->y == -77)))
+ {
+ e_comp_ignore_win_add(E_PIXMAP_TYPE_WL, win);
+ e_object_del(E_OBJECT(ec));
+ return;
+ }
+
+ if (!(ec->comp_data = E_NEW(E_Comp_Client_Data, 1)))
+ {
+ ERR("Could not allocate new client data structure");
+ return;
+ }
+
+ /* set initial client properties */
+ ec->ignored = e_comp_ignore_win_find(win);
+ ec->border_size = 0;
+ ec->placed |= ec->override;
+ ec->new_client ^= ec->override;
+ ec->icccm.accepts_focus = ((!ec->override) && (!ec->input_only));
+
+ /* NB: could not find a better place to do this, BUT for internal windows,
+ * we need to set delete_request else the close buttons on the frames do
+ * basically nothing */
+ if (ec->internal) ec->icccm.delete_request = EINA_TRUE;
+
+ /* set initial client data properties */
+ ec->comp_data->mapped = EINA_FALSE;
+ ec->comp_data->first_damage = ((ec->internal) || (ec->override));
+
+ if ((!e_client_util_ignored_get(ec)) &&
+ (!ec->internal) && (!ec->internal_ecore_evas))
+ {
+ ec->comp_data->need_reparent = EINA_TRUE;
+ ec->take_focus = !starting;
+ }
+
+ /* add this client to the hash */
+ eina_hash_add(clients_win_hash, &win, ec);
+ e_hints_client_list_set();
+
+ /* TODO: first draw timer ? */
+}
+
static Eina_Bool
_e_comp_wl_compositor_create(void)
{
@@ -521,6 +578,9 @@ e_comp_wl_init(void)
/* create hash to store clients */
clients_win_hash = eina_hash_int64_new(NULL);
+ /* add hooks to catch e_client events */
+ e_client_hook_add(E_CLIENT_HOOK_NEW_CLIENT, _e_comp_wl_client_cb_new, NULL);
+
return EINA_TRUE;
}