+}
+
+void stacking_raise(Client *client)
+{
+ g_assert(stacking_list != NULL); /* this would be bad */
+
+ /* move up the transient chain as far as possible first */
+ while (client->transient_for) {
+ if (client->transient_for != TRAN_GROUP) {
+ client = client->transient_for;
+ } else {
+ GSList *it;
+
+ /* the check for TRAN_GROUP is to prevent an infinate loop with
+ 2 transients of the same group at the head of the group's
+ members list */
+ for (it = client->group->members; it; it = it->next) {
+ Client *c = it->data;
+
+ if (c != client && c->transient_for != TRAN_GROUP) {
+ client = it->data;
+ break;
+ }
+ }
+ if (it == NULL) break;
+ }
+ }
+
+ raise_recursive(client);