Hrmmm... Nevermind, this patch is clearly bogus: we shouldn't always set no when the class matches. :(
I'll fix and resend. On Oct 25, 2012, at 18:08, "Kent R. Spillner" <[email protected]> wrote: > Merhaba- > > I use a couple of different autogroups that match on just the client's class > to help me organize my desktop (e.g. Firefox, VirtualBox, XTerm, etc.), but > I also have some "special" windows in these classes that I want to group > separately (*ahem*). Currently, group_autogroup returns the first matching > autogroupwin in the order defined in the config file, but I think it would > be better if we keep looking for a better match. What do you think? > > Below is an initial diff that keeps iterating through autogroupq if the > class matches and the name is NULL; if class and name both match it still > breaks out immediately. This change is suitable for my particular needs, > but it slightly changes the default behavior in that it now returns the > *last* matching autogroup if only the window class is configured > (e.g. autogroup 1 XTerm; ...; autogroup 9 XTerm). > > Best, > Kent > > > Index: group.c > =================================================================== > RCS file: /cvs/xenocara/app/cwm/group.c,v > retrieving revision 1.60 > diff -N -p -u group.c > --- group.c 9 Sep 2012 20:52:57 -0000 1.60 > +++ group.c 25 Oct 2012 22:41:50 -0000 > @@ -429,11 +429,11 @@ group_autogroup(struct client_ctx *cc) > XFree(grpno); > } else { > TAILQ_FOREACH(aw, &Conf.autogroupq, entry) { > - if (strcmp(aw->class, cc->app_class) == 0 && > - (aw->name == NULL || > - strcmp(aw->name, cc->app_name) == 0)) { > + if (strcmp(aw->class, cc->app_class) == 0) { > no = aw->num; > - break; > + if (aw->name != NULL && > + strcmp(aw->name, cc->app_name) == 0) > + break; > } > } > } > Index: group.c > =================================================================== > RCS file: /cvs/xenocara/app/cwm/group.c,v > retrieving revision 1.60 > diff -N -p -u group.c > --- group.c 9 Sep 2012 20:52:57 -0000 1.60 > +++ group.c 25 Oct 2012 22:41:50 -0000 > @@ -429,11 +429,11 @@ group_autogroup(struct client_ctx *cc) > XFree(grpno); > } else { > TAILQ_FOREACH(aw, &Conf.autogroupq, entry) { > - if (strcmp(aw->class, cc->app_class) == 0 && > - (aw->name == NULL || > - strcmp(aw->name, cc->app_name) == 0)) { > + if (strcmp(aw->class, cc->app_class) == 0) { > no = aw->num; > - break; > + if (aw->name != NULL && > + strcmp(aw->name, cc->app_name) == 0) > + break; > } > } > }
