(user_time != 0) &&
/* this checks for focus=false for the window */
(!settings || settings->focus != 0) &&
- focus_valid_target(self, FALSE, FALSE, TRUE, FALSE, FALSE,
+ focus_valid_target(self, self->desktop,
+ FALSE, FALSE, TRUE, FALSE, FALSE,
settings->focus == 1))
{
activate = TRUE;
menu_add_separator(menu, SEPARATOR, screen_desktop_names[desktop]);
for (it = focus_order; it; it = g_list_next(it)) {
ObClient *c = it->data;
- if (focus_valid_target(c, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE))
+ if (focus_valid_target(c, desktop,
+ TRUE, TRUE, FALSE, FALSE, FALSE, FALSE))
{
empty = FALSE;
for (it = focus_order; it; it = g_list_next(it)) {
ObClient *c = it->data;
- if (focus_valid_target(c, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE)) {
+ if (focus_valid_target(c, d->desktop,
+ TRUE, TRUE, FALSE, FALSE, FALSE, FALSE)) {
ObMenuEntry *e;
empty = FALSE;
3. it is not shaded
*/
if ((allow_omnipresent || c->desktop == screen_desktop) &&
- focus_valid_target(c, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE) &&
+ focus_valid_target(c, screen_desktop,
+ TRUE, FALSE, 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, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE) &&
+ if (focus_valid_target(c, screen_desktop,
+ TRUE, FALSE, FALSE, FALSE, TRUE, FALSE) &&
(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, TRUE, iconic_windows, all_desktops,
+ focus_valid_target(c, screen_desktop,
+ TRUE, iconic_windows, all_desktops,
FALSE, FALSE, FALSE))
{
return TRUE;
}
gboolean focus_valid_target(ObClient *ft,
+ guint desktop,
gboolean helper_windows,
gboolean iconic_windows,
gboolean all_desktops,
do this check first because it will usually filter out the most
windows */
- ok = (all_desktops || ft->desktop == screen_desktop ||
+ ok = (all_desktops || ft->desktop == desktop ||
ft->desktop == DESKTOP_ALL);
/* the window can receive focus somehow */
{
ObClient *cft = client_focus_target(ft);
ok = ok && (ft == cft || !focus_valid_target(cft,
+ screen_desktop,
TRUE,
iconic_windows,
all_desktops,
struct _ObClient *focus_order_find_first(guint desktop);
gboolean focus_valid_target(struct _ObClient *ft,
+ guint desktop,
gboolean helper_windows,
gboolean iconic_windows,
gboolean all_desktops,
if (it == NULL) it = g_list_last(list);
}
ft = it->data;
- if (focus_valid_target(ft, TRUE,
+ if (focus_valid_target(ft, screen_desktop, TRUE,
focus_cycle_iconic_windows,
focus_cycle_all_desktops,
focus_cycle_dock_windows,
/* the currently selected window isn't interesting */
if (cur == c)
continue;
- if (!focus_valid_target(it->data, TRUE, FALSE, FALSE, dock_windows,
+ if (!focus_valid_target(it->data, screen_desktop,
+ TRUE, FALSE, FALSE, dock_windows,
desktop_windows, FALSE))
continue;
GList *it;
for (it = focus_order; it; it = g_list_next(it))
- if (focus_valid_target(it->data, TRUE,
+ if (focus_valid_target(it->data, screen_desktop, TRUE,
focus_cycle_iconic_windows,
focus_cycle_all_desktops,
focus_cycle_dock_windows,
for (it = g_list_last(focus_order); it; it = g_list_previous(it)) {
ObClient *ft = it->data;
- if (focus_valid_target(ft, TRUE,
+ if (focus_valid_target(ft, screen_desktop, TRUE,
iconic_windows,
all_desktops,
dock_windows,