- if (hints->flags & WindowGroupHint) {
- if (hints->window_group !=
- (self->group ? self->group->leader : None)) {
- /* remove from the old group if there was one */
- if (self->group != NULL)
- group_remove(self->group, self);
- self->group = group_add(hints->window_group, self);
- }
- } else /* no group! */
- self->group = None;
+ if (!(hints->flags & WindowGroupHint))
+ hints->window_group = None; /* no group */
+ /* did the group state change? */
+ if (hints->window_group != (self->group ? self->group->leader : None)){
+ /* remove from the old group if there was one */
+ if (self->group != NULL)
+ group_remove(self->group, self);
+ if (hints->window_group != None)
+ self->group = group_add(hints->window_group, self);
+
+ /* because the self->transient flag wont change from this call,
+ we don't need to update the window's type and such, only its
+ transient_for, and the transients lists of other windows in the
+ group may be affected */
+ client_update_transient_for(self);
+ }