evas_object_raise(ec->frame);
if (ec->zone != current_zone)
e_util_pointer_center(ec);
- ELOGF("FOCUS", "focus set | window_jump_to", ec);
- e_client_frame_focus_set(ec, EINA_TRUE);
+ if (e_config->focus_policy_ext != E_FOCUS_EXT_TOP_STACK)
+ {
+ ELOGF("FOCUS", "focus set | window_jump_to", ec);
+ e_client_frame_focus_set(ec, EINA_TRUE);
+ }
return 1;
}
return 0;
// e_client_desk_set(ec, e_desk_current_get(zone));
if (max) e_client_maximize(ec, max);
if (fullscreen) e_client_fullscreen(ec, fs);
- ELOGF("FOCUS", "focus set | window_zone_move_by_action", ec);
+ if (e_config->focus_policy_ext != E_FOCUS_EXT_TOP_STACK)
+ {
+ ELOGF("FOCUS", "focus set | window_zone_move_by_action", ec);
+ }
e_client_frame_focus_set(ec, EINA_TRUE);
}
if (!warp_client->lock_focus_out)
{
- ELOGF("FOCUS", "focus set | pointer_warp_to_center", warp_client);
- e_client_frame_focus_set(warp_client, EINA_TRUE);
- e_client_focus_latest_set(warp_client);
+ if (e_config->focus_policy_ext != E_FOCUS_EXT_TOP_STACK)
+ {
+ ELOGF("FOCUS", "focus set | pointer_warp_to_center", warp_client);
+ e_client_frame_focus_set(warp_client, EINA_TRUE);
+ e_client_focus_latest_set(warp_client);
+ }
}
warp_client = NULL;
}
}
static E_Client *
+_e_client_focus_topmost_focusable_get()
+{
+ E_Client *ec = NULL;
+
+ E_CLIENT_REVERSE_FOREACH(ec)
+ {
+ if (_e_client_focus_can_take(ec))
+ return ec;
+ }
+ return NULL;
+}
+
+static E_Client *
_e_client_find_next_focus(E_Client *ec)
{
Eina_List *l = NULL;
e_client_revert_focus(E_Client *ec)
{
E_Client *focus_ec = NULL;
+
+ // check topmost focus policy
+ if (e_config->focus_policy_ext == E_FOCUS_EXT_TOP_STACK)
+ {
+ focus_ec = _e_client_focus_topmost_focusable_get();
+ ELOGF("FOCUS", "focus set | topmost_focus", focus_ec);
+ e_client_frame_focus_set(focus_ec, EINA_TRUE);
+ return;
+ }
+
focus_ec = _e_client_revert_focus_get(ec);
if (focus_ec)
evas_object_raise(ec->frame);
if (!ec->lock_focus_out)
{
- ELOGF("FOCUS", "focus set | reset_lost_window", ec);
- e_client_frame_focus_set(ec, EINA_TRUE);
+ if (e_config->focus_policy_ext != E_FOCUS_EXT_TOP_STACK)
+ {
+ ELOGF("FOCUS", "focus set | reset_lost_window", ec);
+ e_client_frame_focus_set(ec, EINA_TRUE);
+ }
}
e_client_pointer_warp_to_center(ec);
ec->cur_mouse_action->func.go(E_OBJECT(ec), NULL);
if (e_config->border_raise_on_mouse_action)
evas_object_raise(ec->frame);
- ELOGF("FOCUS", "focus set | client eval", ec);
- e_client_frame_focus_set(ec, EINA_TRUE);
+ if (e_config->focus_policy_ext != E_FOCUS_EXT_TOP_STACK)
+ {
+ ELOGF("FOCUS", "focus set | client eval", ec);
+ e_client_frame_focus_set(ec, EINA_TRUE);
+ }
}
ec->changes.visible = 0;
_e_client_event_show(ec);
Eina_Bool inserted = EINA_FALSE;
if (focus_track_frozen > 0) return;
+ if (e_config->focus_policy_ext == E_FOCUS_EXT_TOP_STACK) return;
if (!focus_stack)
{
EINA_SAFETY_ON_NULL_RETURN(zone);
if (zone->display_state == E_ZONE_DISPLAY_STATE_OFF) return;
+ if (e_config->focus_policy_ext == E_FOCUS_EXT_TOP_STACK)
+ {
+ ec = _e_client_focus_topmost_focusable_get();
+ 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)))
EINA_SAFETY_ON_NULL_RETURN(ec);
if (focus_track_frozen > 0) return;
+ if (e_config->focus_policy_ext == E_FOCUS_EXT_TOP_STACK) return;
focus_stack = eina_list_remove(focus_stack, ec);
{
EINA_SAFETY_ON_NULL_RETURN(ec);
if (focus_track_frozen > 0) return;
+ if (e_config->focus_policy_ext == E_FOCUS_EXT_TOP_STACK) return;
focus_stack = eina_list_remove(focus_stack, ec);
focus_stack = eina_list_prepend(focus_stack, ec);
if (!ec) CRI("ACK");
if (focus_track_frozen > 0) return;
+ if (e_config->focus_policy_ext == E_FOCUS_EXT_TOP_STACK) return;
focus_stack = eina_list_remove(focus_stack, ec);
e_client_focus_defer_set(E_Client *ec)
{
EINA_SAFETY_ON_NULL_RETURN(ec);
+ if (e_config->focus_policy_ext == E_FOCUS_EXT_TOP_STACK) return;
defer_focus_stack = eina_list_remove(defer_focus_stack, ec);
defer_focus_stack = eina_list_prepend(defer_focus_stack, ec);
e_client_focus_defer_unset(E_Client *ec)
{
EINA_SAFETY_ON_NULL_RETURN(ec);
+ if (e_config->focus_policy_ext == E_FOCUS_EXT_TOP_STACK) return;
defer_focus_stack = eina_list_remove(defer_focus_stack, ec);
}
E_Client *ec;
const Eina_List *l;
+ if (e_config->focus_policy_ext == E_FOCUS_EXT_TOP_STACK) return;
+
EINA_LIST_FOREACH(e_client_focus_stack_get(), l, ec)
if (ec->desk && ec->desk->visible && (!ec->iconic))
{
* expect us to emulate a look of focus but not actually set x input
* focus as we do - so simply abort any focuse set on such windows */
/* be strict about accepting focus hint */
+ if (e_config->focus_policy_ext == E_FOCUS_EXT_TOP_STACK) return;
+
if ((!ec->icccm.accepts_focus) &&
(!ec->icccm.take_focus)) return;
if (ec->lock_focus_out) return;
else
{
ELOGF("FOCUS", "focus set | client activate", focus_ec);
- e_client_frame_focus_set(focus_ec, EINA_TRUE);
+ if (e_config->focus_policy_ext != E_FOCUS_EXT_TOP_STACK)
+ e_client_frame_focus_set(focus_ec, EINA_TRUE);
}
}
else
if ((ec->modal) && (ec->modal != ec) &&
(ec->modal->visible) && (!e_object_is_del(E_OBJECT(ec->modal))))
{
- ELOGF("FOCUS", "focus set | intercept focus to modal", ec->modal);
- e_client_frame_focus_set(ec->modal, focus);
+ if (e_config->focus_policy_ext != E_FOCUS_EXT_TOP_STACK)
+ {
+ ELOGF("FOCUS", "focus set | intercept focus to modal", ec->modal);
+ e_client_frame_focus_set(ec->modal, focus);
+ }
return;
}
else if ((ec->leader) && (ec->leader->modal) &&
(ec->leader->modal != ec) && ec->leader->modal->visible &&
(!e_object_is_del(E_OBJECT(ec->leader->modal))))
{
- ELOGF("FOCUS", "focus set | intercept focus to leader->modal", ec->leader->modal);
- e_client_frame_focus_set(ec->leader->modal, focus);
+ if (e_config->focus_policy_ext != E_FOCUS_EXT_TOP_STACK)
+ {
+ ELOGF("FOCUS", "focus set | intercept focus to leader->modal", ec->leader->modal);
+ e_client_frame_focus_set(ec->leader->modal, focus);
+ }
return;
}
if (!cw->visible)
focus_ec = e_client_focused_get();
if (focus_ec)
{
- ELOGF("FOCUS", "focus unset | last_focused_focus", focus_ec);
- e_client_frame_focus_set(focus_ec, EINA_FALSE);
+ if (e_config->focus_policy_ext != E_FOCUS_EXT_TOP_STACK)
+ {
+ ELOGF("FOCUS", "focus unset | last_focused_focus", focus_ec);
+ e_client_frame_focus_set(focus_ec, EINA_FALSE);
+ }
}
return NULL;
if (e_client_util_ignored_get(ec)) continue;
if (!e_client_util_desk_visible(ec, desk)) continue;
if (ec->iconic) continue;
- ELOGF("FOCUS", "focus set | desk flip end", ec);
- e_client_frame_focus_set(ec, EINA_TRUE);
+ if (e_config->focus_policy_ext != E_FOCUS_EXT_TOP_STACK)
+ {
+ ELOGF("FOCUS", "focus set | desk flip end", ec);
+ e_client_frame_focus_set(ec, EINA_TRUE);
+ }
if (e_config->raise_on_revert_focus)
evas_object_raise(ec->frame);
return;
E_API void
e_focus_event_mouse_in(E_Client *ec)
{
-
if ((e_config->focus_policy == E_FOCUS_MOUSE) ||
(e_config->focus_policy == E_FOCUS_SLOPPY))
{
- ELOGF("FOCUS", "focus set | mouse in", ec);
- e_client_frame_focus_set(ec, EINA_TRUE);
+ if (e_config->focus_policy_ext != E_FOCUS_EXT_TOP_STACK)
+ {
+ ELOGF("FOCUS", "focus set | mouse in", ec);
+ e_client_frame_focus_set(ec, EINA_TRUE);
+ }
}
if (e_config->use_auto_raise)
{
{
if (ec->focused)
{
+ if (e_config->focus_policy_ext != E_FOCUS_EXT_TOP_STACK)
+ {
ELOGF("FOCUS", "focus unset | mouse out", ec);
e_client_frame_focus_set(ec, EINA_FALSE);
+ }
}
}
}
if (e_client_focus_policy_click(ec) ||
e_config->always_click_to_focus)
{
- ELOGF("FOCUS", "focus set | mouse down", ec);
- e_client_frame_focus_set(ec, EINA_TRUE);
+ if (e_config->focus_policy_ext != E_FOCUS_EXT_TOP_STACK)
+ {
+ ELOGF("FOCUS", "focus set | mouse down", ec);
+ e_client_frame_focus_set(ec, EINA_TRUE);
+ }
if (ec->floating)
evas_object_raise(ec->frame);