all repos — openbox @ 689157e8691330704f1071bc1e23238b56a0b565

openbox fork - make it a bit more like ryudo

only put a transient for the group onto some other desktop if its whole group is over there
Dana Jansens danakj@orodu.net
commit

689157e8691330704f1071bc1e23238b56a0b565

parent

e2da966bcb66df8d6a002bfead189aa2623848e0

1 files changed, 18 insertions(+), 6 deletions(-)

jump to
M openbox/client.copenbox/client.c

@@ -1139,15 +1139,27 @@ if (self->transient_for != OB_TRAN_GROUP) {

self->desktop = self->transient_for->desktop; trdesk = TRUE; } else { + /* if all the group is on one desktop, then open it on the + same desktop */ GSList *it; + gboolean first = TRUE; + guint all = screen_num_desktops; /* not a valid value */ - for (it = self->group->members; it; it = g_slist_next(it)) - if (it->data != self && - !((ObClient*)it->data)->transient_for) { - self->desktop = ((ObClient*)it->data)->desktop; - trdesk = TRUE; - break; + for (it = self->group->members; it; it = g_slist_next(it)) { + ObClient *c = it->data; + if (c != self) { + if (first) { + all = c->desktop; + first = FALSE; + } + else if (all != c->desktop) + all = screen_num_desktops; /* make it invalid */ } + } + if (all != screen_num_desktops) { + self->desktop = all; + trdesk = TRUE; + } } } if (!trdesk) {