On Wed 2019.01.23 at 01:02 -0800, Nam Nguyen wrote:
> This patch for cwm adds group-delete to delete all windows in a group. I
> usually end up with many disposable windows in a group, so this makes it
> easier to manage them.

Hi,

I think this could be useful; however, a comment below.

> Index: group.c
> ===================================================================
> RCS file: /cvs/xenocara/app/cwm/group.c,v
> retrieving revision 1.128
> diff -u -p -r1.128 group.c
> --- group.c   23 Jan 2018 13:48:49 -0000      1.128
> +++ group.c   23 Jan 2019 08:09:37 -0000
> @@ -250,6 +250,24 @@ group_only(struct screen_ctx *sc, int id
>  }
>  
>  void
> +group_delete(struct screen_ctx *sc, int idx)
> +{
> +     struct group_ctx        *gc;
> +     struct client_ctx       *cc;
> +
> +     if (idx < 0 || idx >= Conf.ngroups)
> +             return;
> +
> +     TAILQ_FOREACH(gc, &sc->groupq, entry) {
> +             if (gc->num == idx) {
> +                     TAILQ_FOREACH(cc, &gc->clientq, group_entry) {
> +                             XKillClient(X_Dpy, cc->win);

XKillClient(3) is a big hammer; is there a reason why client_send_delete()
wasn't used? client_send_delete() will call XKillClient(3) if the client
doesn't support the WM_DELETE_WINDOW property.  If there's no specific
reason, no need to re-send a diff.

Thanks!

Reply via email to