only set focus on clients which are visible during client eval

focusing a client will automatically uniconify and desk flip, so
setting focus on a hidden client should be avoided during eval since
these focus-sets are not "user triggered"

this fixes issues where clients could randomly grab focus from other
desks and also restores expected behavior when restarting e on an
empty vdesk
This commit is contained in:
Mike Blumenkrantz 2015-09-21 18:19:03 -04:00
parent 7056d598c4
commit 4a33cd7ba0
1 changed files with 6 additions and 6 deletions

View File

@ -2203,14 +2203,12 @@ _e_client_eval(E_Client *ec)
ec->changes.need_maximize || ec->changes.need_unmaximize;
ec->changes.stack = 0;
if ((!ec->input_only) && ((ec->take_focus) || (ec->want_focus)))
if ((!ec->input_only) && (!ec->iconic) &&
((!ec->zone) || e_client_util_desk_visible(ec, e_desk_current_get(ec->zone))) &&
((ec->take_focus) || (ec->want_focus)))
{
ec->take_focus = 0;
if ((e_config->focus_setting == E_FOCUS_NEW_WINDOW) || (ec->want_focus))
{
ec->want_focus = 0;
e_client_focus_set_with_pointer(ec);
}
e_client_focus_set_with_pointer(ec);
else if (ec->dialog)
{
if ((e_config->focus_setting == E_FOCUS_NEW_DIALOG) ||
@ -2239,6 +2237,8 @@ _e_client_eval(E_Client *ec)
}
}
}
else
ec->take_focus = ec->want_focus = 0;
if (ec->changes.need_maximize)
{