}
static E_Client *
-_focus_policy_history_find_next_focusable_ec(E_Focus_Policy_History *history_policy, E_Client *ec)
+_focus_policy_history_find_next_focusable_ec(E_Focus_Policy_History *history_policy, E_Client *exclude_ec)
{
Eina_List *l = NULL;
E_Client *temp_ec = NULL;
// call the intercept hook of the revert focus
- if (e_client_intercept_hook_focus_revert_call(ec))
+ if (e_client_intercept_hook_focus_revert_call(exclude_ec))
return NULL;
EINA_LIST_FOREACH(history_policy->focus_stack, l, temp_ec)
{
+ if (exclude_ec == temp_ec) continue;
+
if (_e_focus_policy_history_focus_can_take(history_policy, temp_ec))
return temp_ec;
}
}
static E_Client *
-_focus_policy_history_focusable_get(E_Focus_Policy_History *history_policy, E_Client *ec)
+_focus_policy_history_focusable_get(E_Focus_Policy_History *history_policy, E_Client *exclude_ec)
{
E_Client *pec = NULL, *focusable_ec = NULL;
E_Zone *zone;
if (stopping) return NULL;
- if (!ec)
+ if (!exclude_ec)
return _focus_policy_history_find_next_focusable_ec(history_policy, NULL);
zone = history_policy->zone;
+ if (!e_zone_is_displaying(zone)) return NULL;
desk = e_desk_current_get(zone);
if (!desk) return NULL;
- if (!e_comp_client_zone_is_displaying(ec)) return NULL;
if (e_config->focus_policy == E_FOCUS_MOUSE)
{
// set mouse over focus
- pec = e_client_under_pointer_get(desk, ec);
+ pec = e_client_under_pointer_get(desk, exclude_ec);
if (pec)
focusable_ec = pec;
/* no autoraise/revert here because it's probably annoying */
}
else
- focusable_ec = _focus_policy_history_find_next_focusable_ec(history_policy, ec);
+ focusable_ec = _focus_policy_history_find_next_focusable_ec(history_policy, exclude_ec);
return focusable_ec;
}
static void
-_focus_policy_history_next_focus_set(E_Focus_Policy_History *history_policy, E_Client *ec)
+_focus_policy_history_next_focus_set(E_Focus_Policy_History *history_policy, E_Client *exclude_ec)
{
E_Client *focusable_ec;
- focusable_ec = _focus_policy_history_focusable_get(history_policy, ec);
+ focusable_ec = _focus_policy_history_focusable_get(history_policy, exclude_ec);
if (!focusable_ec) return;
- if (focusable_ec != ec)
+ if (focusable_ec != exclude_ec)
{
- _e_focus_policy_history_focus_defer_unset(history_policy, ec);
- ELOGF("FOCUS_HISTORY", "focus unset | revert_focus", ec);
- e_client_frame_focus_set(ec, EINA_FALSE);
+ _e_focus_policy_history_focus_defer_unset(history_policy, exclude_ec);
+ ELOGF("FOCUS_HISTORY", "focus unset | revert_focus", exclude_ec);
+ e_client_frame_focus_set(exclude_ec, EINA_FALSE);
}
if (!focusable_ec->iconic || focusable_ec->exp_iconify.buffer_flush)