- /* If the window is becoming a direct transient for a window in its group
- then any group transients which were our children and are now becoming
- our parents need to stop being our children.
-
- Group transients can't be children of group transients already, but
- we could have any number of direct parents above up, any of which could
- be transient for the group, and we need to remove it from our children.
- */
- if (oldparent != newparent &&
- newparent != NULL && newparent != OB_TRAN_GROUP &&
- newgroup != NULL && newgroup == oldgroup)
- {
- ObClient *look = newparent;
- do {
- self->transients = g_slist_remove(self->transients, look);
- look = look->transient_for;
- } while (look != NULL && look != OB_TRAN_GROUP);
- }
-
-
- /* If the group changed, or if we are just becoming transient for the
- group, then we need to remove any old group transient windows
- from our children. But if we were already transient for the group, then
- other group transients are not our children. */
- if ((oldgroup != newgroup ||
- (newparent == OB_TRAN_GROUP && oldparent != newparent)) &&
- oldgroup != NULL && oldparent != OB_TRAN_GROUP)
- {
- for (it = self->transients; it; it = next) {
- next = g_slist_next(it);
- c = it->data;
- if (c->group == oldgroup)
- self->transients = g_slist_delete_link(self->transients, it);
- }
+ for (it = self->transients; it; it = next) {
+ next = g_slist_next(it);
+ c = it->data;
+ self->transients = g_slist_delete_link(self->transients, it);
+ c->parents = g_slist_remove(c->parents, self);