From 36c3d15c0b8202e3dfc8882b0c17d5d81c6633a6 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Mon, 7 Jul 2014 15:11:56 +0900 Subject: [PATCH] bring back client hook that breaks illume2 + contact i know it's not that pretty, but this brings back the E_CLIENT_HOOK_CANVAS_LAYOUT as there just is no viable replacement and thus breaks 2 modules. this fixes T1402 - we chances are just that this needs a separate hook point as it isnt a per-client but a per-comp hook. --- src/bin/e_client.c | 29 +++++++++++++++++++++++++++++ src/bin/e_client.h | 1 + 2 files changed, 30 insertions(+) diff --git a/src/bin/e_client.c b/src/bin/e_client.c index af66e8941..ec7b2a46b 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -77,6 +77,7 @@ static Eina_Inlist *_e_client_hooks[] = [E_CLIENT_HOOK_DEL] = NULL, [E_CLIENT_HOOK_UNREDIRECT] = NULL, [E_CLIENT_HOOK_REDIRECT] = NULL, + [E_CLIENT_HOOK_CANVAS_LAYOUT] = NULL, }; /////////////////////////////////////////// @@ -324,6 +325,24 @@ _e_client_hook_call(E_Client_Hook_Point hookpoint, E_Client *ec) return !!e_object_unref(E_OBJECT(ec)); } +static Eina_Bool +_e_client_hook_comp_call(E_Client_Hook_Point hookpoint, E_Comp *c) +{ + E_Client_Hook *ch; + + _e_client_hooks_walking++; + _e_client_hooks_walking++; + EINA_INLIST_FOREACH(_e_client_hooks[hookpoint], ch) + { + if (ch->delete_me) continue; + ch->func(ch->data, (void *)c); + } + _e_client_hooks_walking--; + if ((_e_client_hooks_walking == 0) && (_e_client_hooks_delete > 0)) + _e_client_hooks_clean(); + return EINA_TRUE; +} + /////////////////////////////////////////// static void @@ -2206,6 +2225,16 @@ e_client_idler_before(void) _e_client_hook_call(E_CLIENT_HOOK_EVAL_POST_FRAME_ASSIGN, ec); } + // layout hook - this is where a hook gets to figure out what to + // do if anything. + // + // XXX: FIXME - keep this until there is an acceptable replacement + // that can allow layout policie modules to evaluate everything + // at a single point after everything else is done as removing this + // breaks both illume2 and contact ... which didn't get updated to + // have an alternative method implemented + _e_client_hook_comp_call(E_CLIENT_HOOK_CANVAS_LAYOUT, c); + E_CLIENT_FOREACH(c, ec) { // pass 2 - show windows needing show diff --git a/src/bin/e_client.h b/src/bin/e_client.h index 7f08e8bc6..2fec6e158 100644 --- a/src/bin/e_client.h +++ b/src/bin/e_client.h @@ -164,6 +164,7 @@ typedef enum _E_Client_Hook_Point E_CLIENT_HOOK_DEL, E_CLIENT_HOOK_UNREDIRECT, E_CLIENT_HOOK_REDIRECT, + E_CLIENT_HOOK_CANVAS_LAYOUT, E_CLIENT_HOOK_LAST, } E_Client_Hook_Point;