1. it is on the current desktop. this ignores omnipresent
windows, which are problematic in their own rite, unless they are
specifically allowed
- 2. it is a normal type window, don't fall back onto a dock or
- a splashscreen or a desktop window (save the desktop as a
- backup fallback though)
+ 2. it is a valid auto-focus target
+ 3. it is not shaded
*/
if ((allow_omnipresent || c->desktop == screen_desktop) &&
- focus_valid_target(c, FALSE, FALSE, FALSE, FALSE) &&
+ focus_valid_target(c, TRUE, FALSE, FALSE, FALSE, FALSE) &&
+ !c->shaded &&
(allow_refocus || client_focus_target(c) != old) &&
client_focus(c))
{
a splashscreen or a desktop window (save the desktop as a
backup fallback though)
*/
- if (focus_valid_target(c, FALSE, FALSE, FALSE, TRUE) &&
+ if (focus_valid_target(c, TRUE, FALSE, FALSE, FALSE, TRUE) &&
(allow_refocus || client_focus_target(c) != old) &&
client_focus(c))
{
ObClient *c = it->data;
/* check that it's not a helper window to avoid infinite recursion */
if (c != ft && c->type == OB_CLIENT_TYPE_NORMAL &&
- focus_valid_target(c, iconic_windows, all_desktops, FALSE, FALSE))
+ focus_valid_target(c, TRUE, iconic_windows, all_desktops,
+ FALSE, FALSE))
{
return TRUE;
}
}
gboolean focus_valid_target(ObClient *ft,
+ gboolean helper_windows,
gboolean iconic_windows,
gboolean all_desktops,
gboolean dock_windows,
||
/* helper windows are valid targets if... */
(client_helper(ft) &&
- /* ...a window in its group already has focus ... */
- ((focus_client && ft->group == focus_client->group) ||
+ /* ...a window in its group already has focus and we want to
+ include helper windows ... */
+ ((focus_client && ft->group == focus_client->group &&
+ helper_windows) ||
/* ... or if there are no other windows in its group
- that can be cycled to instead */
+ that can be focused instead */
!focus_target_has_siblings(ft, iconic_windows, all_desktops))));
/* it's not set to skip the taskbar (unless it is a type that would be
{
ObClient *cft = client_focus_target(ft);
ok = ok && (ft == cft || !focus_valid_target(cft,
+ TRUE,
iconic_windows,
all_desktops,
dock_windows,