Re: [dwm] view all

From: Ross Mohn <rpmohn_AT_waxandwane.org>
Date: Tue, 29 Aug 2006 07:32:19 -0400

On Tue, 2006-08-29 at 10:11 +0200, Anselm R. Garbe wrote:
> I'd do this in a different way:
>
> void
> viewall(Arg *arg)
> {
> static Bool active = False;
> static Bool *cache = False;
> unsigned int i;
>
> if(!cache)
> cache = emallocz(sizeof(Bool) * ntags);
>
> if((active = !active)) /* toggle */
> for(i = 0; i < ntags; i++)
> cache[i] = seltag[i];
>
> for(i = 0; i < ntags; i++)
> seltag[i] = active ? active : cache[i];
> arrange(NULL);
> }

A view all toggle -- nicely done! It seems to work well.
-RPM
Received on Tue Aug 29 2006 - 13:32:24 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:30:39 UTC