e client focus - fix focus if moving focused window to new desk

if the window being moved to a new desktop is focused, then ensure
after the move to restore focus to the last focused in the focus stack
for this desk to something stays focused.

@fix
This commit is contained in:
Carsten Haitzler 2017-08-30 16:13:50 +09:00
parent b5e75eb264
commit 418319fc94
1 changed files with 6 additions and 0 deletions

View File

@ -2805,6 +2805,7 @@ e_client_desk_set(E_Client *ec, E_Desk *desk)
{
E_Event_Client_Desk_Set *ev;
E_Desk *old_desk;
Eina_Bool was_focused = ec->focused;
E_OBJECT_CHECK(ec);
E_OBJECT_TYPE_CHECK(ec, E_CLIENT_TYPE);
@ -2872,6 +2873,11 @@ e_client_desk_set(E_Client *ec, E_Desk *desk)
e_client_res_change_geometry_restore(ec);
ec->pre_res_change.valid = 0;
}
if (was_focused)
{
E_Client *ec_focus = e_desk_last_focused_focus(old_desk);
if (ec_focus) e_client_focus_set_with_pointer(ec_focus);
}
}
if (ec->stack.prev || ec->stack.next)