all repos — openbox @ 63f748aa3fac4d3ed004a2c5343a51c3a046e21d

openbox fork - make it a bit more like ryudo

Make focus_valid_target() take a desktop argument.

So you can find valid targets on desktops other than the currently visible one
Dana Jansens danakj@orodu.net
commit

63f748aa3fac4d3ed004a2c5343a51c3a046e21d

parent

447cf22597be8b0f60545cd31355b347ac874002

M openbox/client.copenbox/client.c

@@ -290,7 +290,8 @@ /* NET_WM_USER_TIME 0 when mapping means don't focus */

(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;
M openbox/client_list_combined_menu.copenbox/client_list_combined_menu.c

@@ -53,7 +53,8 @@

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;
M openbox/client_list_menu.copenbox/client_list_menu.c

@@ -54,7 +54,8 @@ menu_clear_entries(menu);

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;
M openbox/focus.copenbox/focus.c

@@ -129,7 +129,8 @@ 2. it is a valid auto-focus target

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))

@@ -149,7 +150,8 @@ 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) */ - 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)) {

@@ -273,7 +275,8 @@ for (it = ft->group->members; it; it = g_slist_next(it)) {

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;

@@ -283,6 +286,7 @@ return FALSE;

} gboolean focus_valid_target(ObClient *ft, + guint desktop, gboolean helper_windows, gboolean iconic_windows, gboolean all_desktops,

@@ -296,7 +300,7 @@ /* it's on this desktop unless you want 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 */

@@ -341,6 +345,7 @@ you choose this window and bring the modal one here */

{ ObClient *cft = client_focus_target(ft); ok = ok && (ft == cft || !focus_valid_target(cft, + screen_desktop, TRUE, iconic_windows, all_desktops,
M openbox/focus.hopenbox/focus.h

@@ -65,6 +65,7 @@

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,
M openbox/focus_cycle.copenbox/focus_cycle.c

@@ -115,7 +115,7 @@ it = it->prev;

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,

@@ -186,7 +186,8 @@

/* 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;

@@ -291,7 +292,7 @@ else {

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,
M openbox/focus_cycle_popup.copenbox/focus_cycle_popup.c

@@ -261,7 +261,7 @@ n = 0;

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,