return;
}
-EINTERN void
-e_client_focus_calculate(E_Zone *zone)
+static E_Client *
+_e_client_candidate_focus(E_Zone *zone, E_Client *reverted_focus_ec)
{
- E_Client *defered_focus_ec = NULL, *reverted_focus_ec = NULL;
- E_Client *ec = NULL, *old_focused = NULL, *cec = NULL;
+ E_Client *ec, *cec;
+ E_Client *defered_focus_ec = NULL;
Eina_List *child_list = NULL;
Eina_List *l = NULL;
Eina_Bool child_deferred;
- EINA_SAFETY_ON_NULL_RETURN(zone);
- if (!e_zone_is_displaying(zone)) return;
-
- if (e_config->focus_policy_ext == E_FOCUS_EXT_TOP_STACK)
- {
- ec = _e_client_focus_topmost_focusable_get();
-
- if (ec != focused)
- {
- if (!ec) ELOGF("FOCUS", "focus unset | No focusable ec", focused);
- e_client_frame_focus_set(focused, EINA_FALSE);
-
- if (ec)
- {
- ELOGF("FOCUS", "focus set | topmost focus calculate", ec);
- e_client_frame_focus_set(ec, EINA_TRUE);
- }
- }
- return;
- }
-
- if ((!focused) ||
- (focused != eina_list_data_get(focus_stack)) ||
- (!_e_client_focus_can_take(focused)))
- {
- reverted_focus_ec = _e_client_revert_focus_get(focused);
- if (!reverted_focus_ec && focused)
- {
- e_client_focus_defer_unset(focused);
- old_focused = focused;
- }
- }
-
E_CLIENT_REVERSE_FOREACH(ec)
{
if (!eina_list_data_find(defer_focus_stack, ec)) continue;
defered_focus_ec = ec;
break;
}
+ return defered_focus_ec;
+}
+
+EINTERN void
+e_client_focus_calculate(E_Zone *zone)
+{
+ E_Client *defered_focus_ec = NULL, *reverted_focus_ec = NULL;
+ E_Client *ec = NULL, *old_focused = NULL;
+
+ EINA_SAFETY_ON_NULL_RETURN(zone);
+ if (!e_zone_is_displaying(zone)) return;
+
+ if (e_config->focus_policy_ext == E_FOCUS_EXT_TOP_STACK)
+ {
+ ec = _e_client_focus_topmost_focusable_get();
+
+ if (ec != focused)
+ {
+ if (!ec) ELOGF("FOCUS", "focus unset | No focusable ec", focused);
+ e_client_frame_focus_set(focused, EINA_FALSE);
+
+ if (ec)
+ {
+ ELOGF("FOCUS", "focus set | topmost focus calculate", ec);
+ e_client_frame_focus_set(ec, EINA_TRUE);
+ }
+ }
+ return;
+ }
+
+ if ((!focused) ||
+ (focused != eina_list_data_get(focus_stack)) ||
+ (!_e_client_focus_can_take(focused)))
+ {
+ reverted_focus_ec = _e_client_revert_focus_get(focused);
+ if (!reverted_focus_ec && focused)
+ {
+ e_client_focus_defer_unset(focused);
+ old_focused = focused;
+ }
+ }
+
+ defered_focus_ec = _e_client_candidate_focus(zone, reverted_focus_ec);
if (defered_focus_ec)
{