[dwm] recent changes to dwm (since dwm-3.5)

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Mon, 19 Feb 2007 17:38:24 +0100

On Mon, Feb 19, 2007 at 11:56:18AM -0500, John S. Yates, Jr. wrote:
> Scanning the bundles showing up on [hackers] it is clear that
> those of us who have any significant investment in dwm patches
> are in for rough sledding trying to track this refactoring.
> Will there be appreciable new functionality or is this just
> gilding the lily? At what point will st get any real
> attention?

I don't think that you will need to do nasty things with the
next dwm release when porting your patches. I did following
changes basically:

view.c and tag.c have been merged into screen.c
draw.c has been merged into main.c

Some convenience functions appeared in client.c (detach[stack](),
attach[stack]()), some functions of client.c have been moved to
screen.c and vice versa.

Float[ing] has been renamed into versatile (also in the man
page). isfloat has been renamed to isversatile.

DEFMODE, TILESYMBOL and FLOATSYMBOL have been removed in favor
of the new Layout struct which is initialized in config.h as
follows:

#define LAYOUTS \
static Layout layout[] = { \
        /* symbol function */ \
        { "[]=", tile }, /* first entry is default */ \
        { "><>", versatile }, \
};

So adding a new layout like grid is easy:

#define LAYOUTS \
static Layout layout[] = { \
        /* symbol function */ \
        { "[]=", tile }, /* first entry is default */ \
        { "+++", grid }, \
        { "><>", versatile }, \
};

dotile() has been renamed into tile and is static in screen.o,
dofloat() has been renamed into versatile, but is kept extern
because there are several checks in the wm checking if the
versatile algorithm is in use (except some tile-related checks
in resizemaster() and incnmaster() - which are only performed
in screen.c).

extern Layout *lt; points to the current layout in use,
so all occurences of arrange(); have been replaced with
lt->arrange();, lt->symbol points to the symbol of the layout.

Consequently I renamed all occurences of mode into layout now
(bmw has been renamed to blw for instance).

Besides the resize()-related changes (esp. to configurerequest
and other parts) nothing else has changed.

For those of you, who'd prefer a direct mode switcher I consider
adding following setlayout to mainstream dwm:

void
setlayout(Arg *arg) {
        if(arg->i < 0 || arg->i >= nlayout)
                return;
        lt = &layout[arg->i];
        lt->arrange();
}

This would allow following wmii-2-ish style of working:
[..]
        { MODKEY XK_t, setlayout, { .i = 0 } }, \
        { MODKEY XK_g, setlayout, { .i = 1 } }, \
        { MODKEY XK_f, setlayout, { .i = 2 } }, \
[..]

(as a rough example).

Hope this mail helps anyone to don't loss the track toward 3.6.

Regards,

-- 
 Anselm R. Garbe >< http://www.suckless.org/ >< GPG key: 0D73F361
Received on Mon Feb 19 2007 - 17:38:24 UTC

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