_e_desk_event_simple_add(desk, E_EVENT_DESK_DESKSHOW);
}
-EINTERN E_Client *
-e_desk_last_focused_focus(E_Desk *desk)
-{
- Eina_List *l = NULL;
- E_Client *ec, *ecs = NULL, *focus_ec = NULL;
-
- EINA_LIST_FOREACH(e_client_focus_stack_get(), l, ec)
- {
- if ((!ec->iconic) && (evas_object_visible_get(ec->frame) || ec->changes.visible) &&
- ((ec->desk == desk) || (e_zone_has_ec(desk->zone, ec) && ec->sticky)) &&
- (ec->icccm.accepts_focus || ec->icccm.take_focus) &&
- (ec->netwm.type != E_WINDOW_TYPE_DOCK) &&
- (ec->netwm.type != E_WINDOW_TYPE_TOOLBAR) &&
- (ec->netwm.type != E_WINDOW_TYPE_MENU) &&
- (ec->netwm.type != E_WINDOW_TYPE_SPLASH) &&
- (ec->netwm.type != E_WINDOW_TYPE_DESKTOP))
- {
- /* this was the window last focused in this desktop */
- if (!ec->lock_focus_out)
- {
- if (ec->sticky)
- {
- ecs = ec;
- continue;
- }
- if (ec->changes.visible && (!evas_object_visible_get(ec->frame)))
- ec->want_focus = ec->take_focus = 1;
- else
- e_client_focus_set_with_pointer(ec);
- if (e_config->raise_on_revert_focus)
- e_client_raise(ec);
- return ec;
- }
- }
- }
- if (ecs)
- {
- if (ecs->changes.visible && (!evas_object_visible_get(ecs->frame)))
- ecs->want_focus = ecs->take_focus = 1;
- else
- e_client_focus_set_with_pointer(ecs);
- if (e_config->raise_on_revert_focus)
- e_client_raise(ecs);
- return ecs;
- }
-
- focus_ec = e_client_focused_get();
- if (focus_ec)
- {
- 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;
-}
-
EINTERN void
e_desk_row_add(E_Zone *zone)
{
E_Client *ec;
_e_desk_event_simple_add(desk, E_EVENT_DESK_AFTER_SHOW);
-
- if ((e_config->focus_policy == E_FOCUS_MOUSE) ||
- (e_config->focus_policy == E_FOCUS_SLOPPY))
- {
- ec = e_client_focused_get();
- /* only set focus/warp pointer if currently focused window
- * is on same screen (user hasn't switched screens during transition)
- */
- if (ec && ec->desk && (ec->desk->zone != desk->zone)) return;
- }
- if (starting) return;
- ec = e_desk_last_focused_focus(desk);
- if ((e_config->focus_policy != E_FOCUS_MOUSE) && (!ec))
- {
- /* we didn't previously have a focused window on this desk
- * but we should, so this is probably the first time the
- * user has flipped to this desk. let's be helpful and
- * focus a random window!
- */
- E_CLIENT_REVERSE_FOREACH(ec)
- {
- /* start with top and go down... */
- if (e_client_util_ignored_get(ec)) continue;
- if (!e_client_util_desk_visible(ec, desk)) continue;
- if (ec->iconic) continue;
- 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)
- e_client_raise(ec);
- return;
- }
- }
}
EINTERN unsigned int