Re: [dwm] small dwm tile() patch

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Mon, 11 Feb 2008 11:40:42 +0100

I agree

On Sun, Jan 13, 2008 at 07:28:13PM +0000, Chris Webb wrote:
> I grabbed the latest dwm earlier to port various bits of my own into
> clean patches against the latest dwm. I hadn't looked at the standard
> tile function for a little while, but I notice that the current
> incarnation recalculates the window geometries (mw and th) for each
> client rather than once in front of the client loop. hg bisect says this
> started happening at changeset 1072:5a06b4b69479 when the Xinerama work
> began.
>
> Obviously mw and th are different from monitor to monitor, but within a
> monitor they're constant, so I think the following (trivial) patch is
> correct:
>
> diff --git a/dwm.c b/dwm.c
> --- a/dwm.c
> +++ b/dwm.c
> @@ -1689,12 +1689,13 @@ tile(void) {
> for(n = 0, c = nexttiled(clients, m); c; c = nexttiled(c->next, m))
> n++;
>
> + /* window geoms */
> + mw = (n == 1) ? m->waw : m->mwfact * m->waw;
> + th = (n > 1) ? m->wah / (n - 1) : 0;
> + if(n > 1 && th < bh)
> + th = m->wah;
> +
> for(j = 0, c = mc = nexttiled(clients, m); c; c = nexttiled(c->next, m)) {
> - /* window geoms */
> - mw = (n == 1) ? m->waw : m->mwfact * m->waw;
> - th = (n > 1) ? m->wah / (n - 1) : 0;
> - if(n > 1 && th < bh)
> - th = m->wah;
> if(j == 0) { /* master */
> nx = m->wax;
> ny = m->way;
>
>
> Best wishes,
>
> Chris.
>

-- 
 Anselm R. Garbe >< http://www.suckless.org/ >< GPG key: 0D73F361
Received on Mon Feb 11 2008 - 11:40:42 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:18:44 UTC