Re: [dwm] new windows on slave area

From: Tener Hades <tener.hades_AT_gmail.com>
Date: Fri, 19 Jan 2007 17:14:48 +0000

On Fri, Jan 19, 2007 at 08:57:57PM +0100, Oliver Heins wrote:
> "Sander van Dijk" <a.h.vandijk_AT_gmail.com>
> writes:
>
> > On 1/19/07, pancake <pancake_AT_youterm.com> wrote:
> >> I've defined two symbols for the tile and append modes:
> >>
> >> #define TILESYMBOL "[<="
> >> #define APPENDSYMBOL "[>="
> >>
> >> So it looks cleaner for me, instead of "const char *..[]={"[<=",...}"
>
> [...]

Cleaner in config.h, yes. But it's much cleaner in draw.c:drawstatus()
my way. With two #define's, you'd need either an if/else (which would
add to the LOC gaol) or a nested ternary operator.

Instead of:
    drawtext(arrange == dofloat ? FLOATSYMBOL : TILESYMBOL[apwl], dc.norm, False, False);

It'd be:
    drawtext(arrange == dofloat ? FLOATSYMBOL : (apwl ? TILESYMBOL : APPENDSYMBOL), dc.norm, False, False);

or:
    if (apwl)
        drawtext...
    else
        drawtext...

I can't be bothered to type it. You get the idea. In the latter cases,
an extra gate would have to be used by the processor (slowing dwm down
by one CPU cycle or so) and adds to the confusion.

I think resonable/moderately obvious defaults should be used with a
manual reference.

Btw,
My first version of the patch was a tag-lookalike with either an "A"
and unfilled for append or a "P" and filled for prepend. This was not
reasonable...

> > I don't think this is needed, especially the extra symbol.
>
> I'm not sure if I understand you, but for me the APPENDSYMBOL is
> essential to know in what mode I am. This is a really useful feature
> (whereas the %u indicator wasn't).

The extra symbol in config.h (instead of #define TILESYMBOL const char..)
would make the functionality clearer to those who haven't/can't read the
source, but if this gets added to main, surely it will have its own piece
of the dwm.1

Users should always consult the man anyways.

> On a system where i did not apply tenders patch to the patch, I usually
> get totally confused and insert new windows to the wrong column in 50%
> of the time. So there is no real difference from a user pov if i apply
> the patch or not -- windows certainly get inserted at a place i don't
> want them to be.

s/tender/tener/

You'll get used to it over time. I made the patch to the patch because
I really liked the functionality but couldn't remember which mode I was
in the next morning after I applied it (I watch a lot of videos with
nmaster == 2 (video/playlist) and mplayer doesn't really -zoom well on
my vid card).

I wrote this followup backwards, sorry for the repitition.

One quick note, I did things pretty sloppy in main.c:setup() after
  /* geometry */
so, ATM, both symbols have to be the same length, or bad things may
happen...

[/tener]

--
Xgwdto{ gphaiit pd dfreh_ ufhnj jq om dph]yc}a}o
Received on Sat Jan 20 2007 - 00:14:13 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:35:23 UTC