- gboolean fs;
- Client *c;
-
- /* are we fullscreen, or do we have a fullscreen transient parent? */
- c = self;
- fs = FALSE;
- while (c && c != TRAN_GROUP) { /* XXX do smthng with the TRAN_GROUP case?*/
- if (c->fullscreen) {
- fs = TRUE;
- break;
- }
- c = c->transient_for;
- }
- if (!fs && self->fullscreen) {
- /* is one of our transients focused? */
- c = search_focus_tree(self, self);
- if (c != NULL) fs = TRUE;
+ gboolean f;
+
+ /* transients take on the layer of their parents */
+ if (self->transient_for) {
+ if (self->transient_for != TRAN_GROUP) {
+ self = self->transient_for;
+ } else {
+ GSList *it;
+
+ for (it = self->group->members; it; it = it->next)
+ if (it->data != self &&
+ ((Client*)it->data)->transient_for != TRAN_GROUP) {
+ self = self->transient_for;
+ break;
+ }
+ }