summaryrefslogtreecommitdiff
path: root/openbox/client.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-06-06 14:34:22 +0000
committerDana Jansens <danakj@orodu.net>2007-06-06 14:34:22 +0000
commitd0bde36aa7a898c4ff4206b82dfcac4ab8466cb4 (patch)
tree579dbb4d93d7df3e55a06221e8dc25de667a09e1 /openbox/client.c
parent7a13f918758f5426d1115b7992bbb4bd7be17c0b (diff)
better code for the last commit. let transients get focus when a group member is focused too.
Diffstat (limited to 'openbox/client.c')
-rw-r--r--openbox/client.c40
1 files changed, 27 insertions, 13 deletions
diff --git a/openbox/client.c b/openbox/client.c
index 5aa9ba74..5661aa13 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -489,7 +489,8 @@ void client_manage(Window window)
"desktop\n");
}
/* If something is focused, and it's not our relative... */
- else if (focus_client && client_search_focus_tree_full(self) == NULL)
+ else if (focus_client && client_search_focus_tree_full(self) == NULL &&
+ client_search_focus_group_full(self) == NULL)
{
/* If time stamp is old, don't steal focus */
if (self->user_time && last_time &&
@@ -2367,19 +2368,20 @@ ObClient *client_search_focus_tree(ObClient *self)
ObClient *client_search_focus_tree_full(ObClient *self)
{
- GSList *it;
- ObClient *c;
-
- if (self->transient_for && self->transient_for != OB_TRAN_GROUP) {
- if ((c = client_search_focus_tree_full(self->transient_for)))
- return c;
- }
+ if (self->transient_for) {
+ if (self->transient_for != OB_TRAN_GROUP) {
+ return client_search_focus_tree_full(self->transient_for);
+ } else {
+ GSList *it;
- for (it = self->group->members; it; it = g_slist_next(it)) {
- if (it->data != self) {
- c = it->data;
- if (client_focused(c)) return c;
- if ((c = client_search_focus_tree(it->data))) return c;
+ 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;
+ }
+ }
}
}
@@ -2390,6 +2392,18 @@ ObClient *client_search_focus_tree_full(ObClient *self)
return client_search_focus_tree(self);
}
+ObClient *client_search_focus_group_full(ObClient *self)
+{
+ GSList *it;
+
+ for (it = self->group->members; it; it = g_slist_next(it)) {
+ ObClient *c = it->data;
+
+ if (client_focused(c)) return c;
+ if ((c = client_search_focus_tree(it->data))) return c;
+ }
+}
+
gboolean client_has_parent(ObClient *self)
{
if (self->transient_for) {