break out client frame setting into helper function

This commit is contained in:
Mike Blumenkrantz 2014-01-20 00:00:45 -05:00
parent 04f7b59e11
commit bcee2e34aa
1 changed files with 59 additions and 54 deletions

View File

@ -1979,42 +1979,8 @@ _e_client_eval(E_Client *ec)
_e_client_hook_call(E_CLIENT_HOOK_EVAL_END, ec);
}
////////////////////////////////////////////////
EINTERN void
e_client_idler_before(void)
{
const Eina_List *l;
E_Comp *c;
if (!eina_hash_population(clients_hash)) return;
EINA_LIST_FOREACH(e_comp_list(), l, c)
{
Eina_List *ll;
E_Client *ec;
EINA_LIST_FOREACH(c->clients, ll, ec)
{
int urgent = ec->icccm.urgent;
Eina_Stringshare *title;
// pass 1 - eval0. fetch properties on new or on change and
// call hooks to decide what to do - maybe move/resize
if (!ec->changed) continue;
if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_FETCH, ec)) continue;
/* FETCH is hooked by the compositor to get client hints */
title = e_client_name_get(ec);
if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_FETCH, ec)) continue;
if (title != e_client_name_get(ec))
_e_client_event_property(ec, E_CLIENT_PROPERTY_TITLE);
/* PRE_POST_FETCH calls e_remember apply for new client */
if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_POST_FETCH, ec)) continue;
if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_POST_FETCH, ec)) continue;
if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_FRAME_ASSIGN, ec)) continue;
if ((ec->border.changed) && (!ec->shaded) &&
(!(((ec->maximized & E_MAXIMIZE_TYPE) == E_MAXIMIZE_FULLSCREEN))))
static void
_e_client_frame_update(E_Client *ec)
{
const char *bordername;
Eina_Stringshare *pborder;
@ -2070,6 +2036,45 @@ e_client_idler_before(void)
ec->border.name = pborder;
}
}
}
////////////////////////////////////////////////
EINTERN void
e_client_idler_before(void)
{
const Eina_List *l;
E_Comp *c;
if (!eina_hash_population(clients_hash)) return;
EINA_LIST_FOREACH(e_comp_list(), l, c)
{
Eina_List *ll;
E_Client *ec;
EINA_LIST_FOREACH(c->clients, ll, ec)
{
int urgent = ec->icccm.urgent;
Eina_Stringshare *title;
// pass 1 - eval0. fetch properties on new or on change and
// call hooks to decide what to do - maybe move/resize
if (!ec->changed) continue;
if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_FETCH, ec)) continue;
/* FETCH is hooked by the compositor to get client hints */
title = e_client_name_get(ec);
if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_FETCH, ec)) continue;
if (title != e_client_name_get(ec))
_e_client_event_property(ec, E_CLIENT_PROPERTY_TITLE);
/* PRE_POST_FETCH calls e_remember apply for new client */
if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_POST_FETCH, ec)) continue;
if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_POST_FETCH, ec)) continue;
if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_FRAME_ASSIGN, ec)) continue;
if ((ec->border.changed) && (!ec->shaded) &&
(!(((ec->maximized & E_MAXIMIZE_TYPE) == E_MAXIMIZE_FULLSCREEN))))
{
_e_client_frame_update(ec);
ec->border.changed = 0;
}
if (urgent != ec->icccm.urgent)