[E_COMP_OBJECT_HOOK_RENDER_UPDATE_LOCK_SET] = NULL,
//#ifdef REFACTOR_FOCUS_POLICY
[E_COMP_OBJECT_HOOK_LOWER] = NULL,
- [E_COMP_OBJECT_HOOK_MOVE] = NULL,
[E_COMP_OBJECT_HOOK_SHOW] = NULL,
[E_COMP_OBJECT_HOOK_HIDE] = NULL,
//#endif
}
static void
+_focus_policy_history_hook_cb_client_move(void *data, E_Client *ec)
+{
+ E_Focus_Policy_History *history_policy;
+ E_Zone *zone;
+
+ history_policy = (E_Focus_Policy_History *)data;
+ if (!history_policy) return;
+
+ E_FOCUS_HISTORY_TRACE(history_policy, ec);
+
+ zone = e_comp_zone_find_by_ec(ec);
+ if (!zone) return;
+
+ // no need to change the focused ec when ec is not focused.
+ if (!ec->focused) return;
+
+ // no need to change the focused ec when ec is in the area of a zone.
+ if (!E_INTERSECTS(ec->x, ec->y, ec->w, ec->h,
+ zone->x, zone->y, zone->w, zone->h))
+ {
+ // find the next focus and set it
+ _focus_policy_history_next_focus_set(history_policy, ec);
+ }
+}
+
+static void
_focus_policy_history_hook_cb_client_focus_defer_set(void *data, E_Client *ec)
{
E_Focus_Policy_History *history_policy;
}
static Eina_Bool
-_focus_policy_history_hook_cb_comp_object_move(void *data, E_Client *ec)
-{
- E_Focus_Policy_History *history_policy;
- E_Zone *zone;
-
- history_policy = (E_Focus_Policy_History *)data;
- if (!history_policy) return EINA_TRUE;
-
- // no need to change the focused ec when ec is not focused.
- if (!ec->focused) return EINA_TRUE;
-
- zone = e_comp_zone_find_by_ec(ec);
- if (!zone) return EINA_TRUE;
-
- // no need to change the focused ec when ec is in the area of a zone.
- if (E_INTERSECTS(ec->x, ec->y, ec->w, ec->h,
- zone->x, zone->y, zone->w, zone->h))
- return EINA_TRUE;
-
- // find the next focus and set it
- _focus_policy_history_next_focus_set(history_policy, ec);
-
- return EINA_TRUE;
-}
-
-static Eina_Bool
_focus_policy_history_hook_cb_comp_object_show(void *data, E_Client *ec)
{
E_Focus_Policy_History *history_policy;
E_LIST_HOOK_APPEND(history_policy->ec_hooks, E_CLIENT_HOOK_FOCUS_SET, _focus_policy_history_hook_cb_client_focus_set, history_policy);
E_LIST_HOOK_APPEND(history_policy->ec_hooks, E_CLIENT_HOOK_FOCUS_UNSET, _focus_policy_history_hook_cb_client_focus_unset, history_policy);
E_LIST_HOOK_APPEND(history_policy->ec_hooks, E_CLIENT_HOOK_LOWER, _focus_policy_history_hook_cb_client_lower, history_policy);
+ E_LIST_HOOK_APPEND(history_policy->ec_hooks, E_CLIENT_HOOK_MOVE, _focus_policy_history_hook_cb_client_move, history_policy);
E_LIST_HOOK_APPEND(history_policy->ec_hooks, E_CLIENT_HOOK_FOCUS_DEFER_SET, _focus_policy_history_hook_cb_client_focus_defer_set, history_policy);
E_LIST_HOOK_APPEND(history_policy->ec_hooks, E_CLIENT_HOOK_FOCUS_LATEST_SET, _focus_policy_history_hook_cb_client_focus_latest_set, history_policy);
E_LIST_HOOK_APPEND(history_policy->ec_hooks, E_CLIENT_HOOK_ACTIVATE_DONE, _focus_policy_history_hook_cb_client_activate_done, history_policy);
// e_comp_object hooks
E_COMP_COMP_HOOK_APPEND(history_policy->co_hooks, E_COMP_OBJECT_HOOK_LOWER, _focus_policy_hook_history_cb_comp_object_lower, history_policy);
- E_COMP_COMP_HOOK_APPEND(history_policy->co_hooks, E_COMP_OBJECT_HOOK_MOVE, _focus_policy_history_hook_cb_comp_object_move, history_policy);
E_COMP_COMP_HOOK_APPEND(history_policy->co_hooks, E_COMP_OBJECT_HOOK_SHOW, _focus_policy_history_hook_cb_comp_object_show, history_policy);
E_COMP_COMP_HOOK_APPEND(history_policy->co_hooks, E_COMP_OBJECT_HOOK_HIDE, _focus_policy_history_hook_cb_comp_object_hide, history_policy);
GMutex focused_ec_mutex;
Eina_List *ec_hooks;
- Eina_List *co_hooks;
Eina_List *zone_hooks;
};
}
static void
-_focus_policy_topmost_hook_cb_client_eval_end(void *data, E_Client *ec)
+_focus_policy_topmost_hook_cb_client_move(void *data, E_Client *ec)
{
E_Focus_Policy_Topmost *topmost_policy;
+ E_Zone *zone;
topmost_policy = (E_Focus_Policy_Topmost *)data;
if (!topmost_policy) return;
- if (e_object_is_del(E_OBJECT(ec))) return;
+ zone = e_comp_zone_find_by_ec(ec);
+ if (!zone) return;
- ec->take_focus = ec->want_focus = 0;
+ // no need to change the focused ec when ec is not focused.
+ if (!ec->focused) return;
+
+ // no need to change the focused ec when ec is in the area of a zone.
+ if (!E_INTERSECTS(ec->x, ec->y, ec->w, ec->h,
+ zone->x, zone->y, zone->w, zone->h))
+ {
+ // find the next focus and set it
+ _focus_policy_topmost_next_focus_set(topmost_policy);
+ }
}
-static Eina_Bool
-_focus_policy_topmost_hook_cb_comp_object_move(void *data, E_Client *ec)
+static void
+_focus_policy_topmost_hook_cb_client_eval_end(void *data, E_Client *ec)
{
E_Focus_Policy_Topmost *topmost_policy;
- E_Zone *zone;
topmost_policy = (E_Focus_Policy_Topmost *)data;
- if (!topmost_policy) return EINA_TRUE;
-
- // no need to change the focused ec when ec is not focused.
- if (!ec->focused) return EINA_TRUE;
-
- zone = e_comp_zone_find_by_ec(ec);
- if (!zone) return EINA_TRUE;
-
- // no need to change the focused ec when ec is in the area of a zone.
- if (E_INTERSECTS(ec->x, ec->y, ec->w, ec->h,
- zone->x, zone->y, zone->w, zone->h))
- return EINA_TRUE;
+ if (!topmost_policy) return;
- // find the next focus and set it
- _focus_policy_topmost_next_focus_set(topmost_policy);
+ if (e_object_is_del(E_OBJECT(ec))) return;
- return EINA_TRUE;
+ ec->take_focus = ec->want_focus = 0;
}
static void
if (!topmost_policy) return;
E_FREE_LIST(topmost_policy->zone_hooks, e_zone_hook_del);
- E_FREE_LIST(topmost_policy->co_hooks, e_comp_object_hook_del);
E_FREE_LIST(topmost_policy->ec_hooks, e_client_hook_del);
g_mutex_clear(&topmost_policy->focused_ec_mutex);
E_LIST_HOOK_APPEND(topmost_policy->ec_hooks, E_CLIENT_HOOK_FOCUS_SET, _focus_policy_topmost_hook_cb_client_focus_set, topmost_policy);
E_LIST_HOOK_APPEND(topmost_policy->ec_hooks, E_CLIENT_HOOK_FOCUS_UNSET, _focus_policy_topmost_hook_cb_client_focus_unset, topmost_policy);
E_LIST_HOOK_APPEND(topmost_policy->ec_hooks, E_CLIENT_HOOK_LOWER, _focus_policy_topmost_hook_cb_client_lower, topmost_policy);
+ E_LIST_HOOK_APPEND(topmost_policy->ec_hooks, E_CLIENT_HOOK_MOVE, _focus_policy_topmost_hook_cb_client_move, topmost_policy);
E_LIST_HOOK_APPEND(topmost_policy->ec_hooks, E_CLIENT_HOOK_EVAL_END, _focus_policy_topmost_hook_cb_client_eval_end, topmost_policy);
- // e_comp_object hooks
- E_COMP_COMP_HOOK_APPEND(topmost_policy->co_hooks, E_COMP_OBJECT_HOOK_MOVE, _focus_policy_topmost_hook_cb_comp_object_move, topmost_policy);
-
// e_zone hooks
zone_hook = e_zone_hook_add(E_ZONE_HOOK_FOCUS_CLEAR, _focus_policy_topmost_hook_cb_zone_focus_clear, topmost_policy);
if (zone_hook) topmost_policy->zone_hooks = eina_list_append(topmost_policy->zone_hooks, zone_hook);