+ObClient *client_search_focus_parent(ObClient *self)
+{
+ if (self->transient_for) {
+ if (self->transient_for != OB_TRAN_GROUP) {
+ if (client_focused(self->transient_for))
+ return self->transient_for;
+ } else {
+ GSList *it;
+
+ for (it = self->group->members; it; it = it->next) {
+ ObClient *c = it->data;
+
+ /* checking transient_for prevents infinate loops! */
+ if (c != self && !c->transient_for)
+ if (client_focused(c))
+ return c;
+ }
+ }
+ }
+
+ return NULL;
+}
+
+ObClient *client_search_parent(ObClient *self, ObClient *search)
+{
+ if (self->transient_for) {
+ if (self->transient_for != OB_TRAN_GROUP) {
+ if (self->transient_for == search)
+ return search;
+ } else {
+ GSList *it;
+
+ for (it = self->group->members; it; it = it->next) {
+ ObClient *c = it->data;
+
+ /* checking transient_for prevents infinate loops! */
+ if (c != self && !c->transient_for)
+ if (c == search)
+ return search;
+ }
+ }
+ }
+
+ return NULL;
+}
+