Re: [dwm] Border hater, border lover

From: Anselm R Garbe <garbeam_AT_gmail.com>
Date: Sun, 3 Aug 2008 13:26:27 +0100

2008/8/3 Sunnan <sunnan_AT_handgranat.org>:
> Well, I've experienced some buggy behavior and I have no idea what the
> problem might be and if it's because of this hack or not. The
> behaviour is that sometimes I'll have two clients visible (one per tag
> and both tags visible) and then both try to be master, one taking up
> mh (I'm using bstack) and one taking up wh-mh but both starting at the
> top of the screen.

That might be a issue in bstack, but I never noticed such behavior in
default dwm.

> Anyway, I found a nicer-looking (???) way to code my original
> suggestion; instead of:
> if(n==1)
> resize(c, wx-c->bw, wy-c->bw, ww, wh, False);
> else
> resize(c, wx, wy, ww - 2 * c->bw, mh - 2 * c->bw, resizehints);
>
> if(--n == 0)
> return;
>
> The two checks can be folded into one, like this:
>
> if (--n == 0) {
> resize(c, wx-c->bw, wy-c->bw, ww, wh, resizehints);
> return;
> }
> resize(c, wx, wy, ww - 2 * c->bw, mh - 2 * c->bw, resizehints);
>
> the guard clause allowing us to eliminate the else.

Hmm, there is no need for --n.

if(n == 1) {
        resize(c, wx-c->bw, wy-c->bw, ww, wh, resizehints);
        return;
}
...

> Btw, there's a huge amount of "- 2 * c->bw" in dwm; maybe this could
> be extracted to a function or macro?

Yeah, might look cleaner.

Kind regards,
--Anselm
Received on Sun Aug 03 2008 - 12:26:27 UTC

This archive was generated by hypermail 2.2.0 : Sun Aug 03 2008 - 12:36:03 UTC