summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-28 02:02:13 +0000
committerDana Jansens <danakj@orodu.net>2007-05-28 02:02:13 +0000
commite9f6255b187e9f9283a3d3e3533a6995a77749e3 (patch)
tree4866142927b635ad8676a6a39066fab0e4de7a7a
parent30912d467a36b13c0d04c98a0bf8ec1b8c1cc593 (diff)
properly search for a focused window in the transient tree
-rw-r--r--openbox/client.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/openbox/client.c b/openbox/client.c
index 5c025229..2974083a 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -2355,21 +2355,19 @@ ObClient *client_search_focus_tree_full(ObClient *self)
return client_search_focus_tree_full(self->transient_for);
} else {
GSList *it;
- gboolean recursed = FALSE;
- for (it = self->group->members; it; it = g_slist_next(it))
- if (!((ObClient*)it->data)->transient_for) {
- ObClient *c;
- if ((c = client_search_focus_tree_full(it->data)))
- return c;
- recursed = TRUE;
+ for (it = self->group->members; it; it = g_slist_next(it)) {
+ if (it->data != self) {
+ ObClient *c = it->data;
+
+ if (client_focused(c)) return c;
+ if ((c = client_search_focus_tree(it->data))) return c;
}
- if (recursed)
- return NULL;
+ }
}
}
- /* this function checks the whole tree, the client_search_focus_tree~
+ /* this function checks the whole tree, the client_search_focus_tree
does not, so we need to check this window */
if (client_focused(self))
return self;