EINTERN void
e_comp_idler_before(void)
{
- Eina_Bool check_focus = EINA_FALSE;
+ Eina_List *screens;
+ E_Screen *screen;
+ E_Policy_Zone *policy_zone;
E_Zone *zone;
- Eina_List *zl;
+ Eina_List *s;
+ Eina_Bool check_focus = EINA_FALSE;
Eina_Bool e_visibility_changed = EINA_FALSE;
- // TODO: call e_zone_idle_before() for each zone
- e_client_idler_before(&check_focus);
+ screens = (Eina_List *)e_comp_screen_e_screens_get(e_comp_screen_get());
+ EINA_SAFETY_ON_NULL_RETURN(screens);
+
+ // evaluate the e_client policy of each zone
+ EINA_LIST_FOREACH(screens, s, screen)
+ {
+ policy_zone = e_screen_policy_zone_get(screen);
+ if (!policy_zone) continue;
+
+ // FIXME: check_focus has to be checked in each zone
+ e_policy_zone_evaluate(policy_zone, &check_focus);
+ }
+
+ // don't evaluate the visibility calculation if norender is enabled
+ if (e_comp_canvas_norender_get() > 0)
+ return;
- if (e_comp_canvas_norender_get() <= 0)
+ // evaluate the visibility of each zone
+ EINA_LIST_FOREACH(screens, s, screen)
{
- EINA_LIST_FOREACH(e_comp->zones, zl, zone)
- {
- e_visibility_changed = EINA_FALSE;
-
- if (e_comp_visibility_calculation_get())
- e_visibility_changed = e_policy_zone_visibility_calculate(zone);
-
- if (zone->focus &&
- (check_focus ||
- (e_zone_focused_client_get(zone) == NULL) ||
- e_visibility_changed))
- {
-
- e_focus_update(zone->focus);
- }
- }
- e_comp_visibility_calculation_set(EINA_FALSE);
+ policy_zone = e_screen_policy_zone_get(screen);
+ if (!policy_zone) continue;
+
+ zone = e_policy_zone_get_zone(policy_zone);
+ if (!zone) continue;
+
+ e_visibility_changed = EINA_FALSE;
+
+ if (e_comp_visibility_calculation_get())
+ e_visibility_changed = e_policy_zone_visibility_calculate(policy_zone);
+
+ if (zone->focus &&
+ (check_focus ||
+ (e_zone_focused_client_get(zone) == NULL) ||
+ e_visibility_changed))
+ {
+ e_focus_update(zone->focus);
+ }
}
+ e_comp_visibility_calculation_set(EINA_FALSE);
}
EINTERN void
#include "e_hwc_window_intern.h"
#include "e_canvas_intern.h"
#include "e_policy_visibility_intern.h"
-#include "e_policy_stack_intern.h"
-#include "e_policy_wl_intern.h"
#define PRI(ec) ((E_Client_Private *)e_object_data_get(E_OBJECT(ec)))
return EINA_FALSE;
}
-EINTERN void
-e_client_idler_before(Eina_Bool *check_focus)
-{
- E_Zone *zone;
- E_Client *ec;
-
- *check_focus = EINA_FALSE;
-
- if (!e_client_clients_hash_exist()) return;
-
- TRACE_DS_BEGIN(CLIENT:IDLE BEFORE);
-
- E_COMP_ZONE_FOREACH(zone)
- E_ZONE_CLIENT_FOREACH(zone, ec)
- {
- // pass 1 - eval0. fetch properties on new or on change and
- // call hooks to decide what to do - maybe move/resize
- if (ec->ignored || (!ec->changed)) continue;
-
- e_policy_stack_transient_for_fetch(ec);
- if (!e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_FETCH, ec)) continue;
-
- /* FETCH is hooked by the compositor to get client hints */
- if (!e_client_hook_call(E_CLIENT_HOOK_EVAL_FETCH, ec)) continue;
-
- if (ec->new_client)
- {
- e_client_type_update(ec);
- }
-
- /* PRE_POST_FETCH calls e_remember apply for new client */
- e_policy_wl_notification_level_fetch(ec);
- if (!e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_POST_FETCH, ec)) continue;
-
- e_policy_client_evaluation(ec);
- 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;
-
- e_client_hook_call(E_CLIENT_HOOK_EVAL_POST_FRAME_ASSIGN, ec);
- }
-
- // pass 2 - show and hide windows needing hide and eval (main eval)
- E_COMP_ZONE_FOREACH(zone)
- E_ZONE_CLIENT_FOREACH(zone, ec)
- {
- if (e_object_is_del(E_OBJECT(ec))) continue;
- if (ec->ignored)
- {
- // ignored client but needing eval (aux hint) such as remote surfaces
- if (ec->changed)
- {
- E_Comp_Wl_Client_Data *cdata = e_client_cdata_get(ec);
- if (cdata && cdata->first_commit)
- e_client_aux_hint_eval(ec);
- }
- continue;
- }
-
- if (ec->changes.visible)
- {
- if (ec->visible)
- {
- if ((!ec->new_client) &&
- (!ec->changes.pos) &&
- (!ec->changes.size))
- {
- e_view_client_show(PRI(ec)->view_client);
- ec->changes.visible = !e_view_client_visible_get(PRI(ec)->view_client);
- }
- }
- else
- {
- e_view_client_hide(PRI(ec)->view_client);
- ec->changes.visible = 0;
- }
- }
-
- if (ec->changed)
- {
- e_client_eval(ec);
- e_comp_visibility_calculation_set(EINA_TRUE);
- if (ec->changes.accepts_focus)
- *check_focus = EINA_TRUE;
- ec->changes.accepts_focus = 0;
-
- if (e_client_focus_check_get(ec))
- {
- *check_focus = EINA_TRUE;
- e_client_focus_check_set(ec, EINA_FALSE);
- }
- }
-
- if ((ec->changes.visible) && (ec->visible) && (!ec->changed))
- {
- e_view_client_show(PRI(ec)->view_client);
- ec->changes.visible = !e_view_client_visible_get(PRI(ec)->view_client);
- ec->changed = ec->changes.visible;
- e_comp_visibility_calculation_set(EINA_TRUE);
- }
- }
-
- TRACE_DS_END();
-}
-
static Eina_Bool
_e_client_cb_hook_comp_render_update_lock_set(void *data, E_Client *ec)
{