+ if (self->group) {
+ GSList *it;
+
+ for (it = self->group->members; it; it = it->next)
+ if (client_focused(it->data)) {
+ group_foc = TRUE;
+ break;
+ }
+ }
+ if (!group_foc && self->transient_for) {
+ if (self->transient_for != TRAN_GROUP) {/* transient of a window */
+ parent = self->transient_for;
+ } else { /* transient of a group */
+ GSList *it;
+
+ for (it = self->group->members; it; it = it->next)
+ if (it->data != self &&
+ ((Client*)it->data)->transient_for != TRAN_GROUP)
+ parent = it->data;
+ }
+ }
+ /* note the check against Type_Normal, not client_normal(self), which
+ would also include dialog types. in this case we want more strict
+ rules for focus */
+ if ((config_focus_new &&
+ (self->type == Type_Normal ||
+ (self->type == Type_Dialog &&
+ (group_foc ||
+ (!parent && (!self->group ||
+ !self->group->members->next)))))) ||
+ (parent && (client_focused(parent) ||
+ search_focus_tree(parent, parent)))) {
+ client_focus(self);
+ }
+ }