> I'm not sure I really understand what you ask. dwm prepends the
> window list, because that's a very simple list operation. If
> you want an append, you only have to patch manage().
I've implemented an initial version of the patch to append windows in
the slave area (at the end of the list).
It mostly works, but ATM it have a bug that the first node does not properly
set the previous one.
You can switch to append mode with META+e and back to the normal mode with
META+a.
My patch can be easily kissized, but firsly I want to fix this bug. Does
anyone see where's the problem?
Thanks.
--pancake
diff -ru dwm-3.1.orig/client.c dwm-3.1/client.c
--- dwm-3.1.orig/client.c 2007-01-16 11:41:35.000000000 +0100
+++ dwm-3.1/client.c 2007-01-17 00:55:48.000000000 +0100
@@ -157,11 +157,30 @@
settags(c, getclient(trans));
if(!c->isfloat)
c->isfloat = trans || c->isfixed;
- if(clients)
+
+ if (apwl) {
+ Client *tc;
+
+ if(!clients)
+ stack = clients = c;
+
+ c->prev = clients;
+ for(tc = clients; tc && tc->next; tc = tc->next)
+ c->prev = tc->next;
+ tc->next = tc->snext = c;
+
+ c->next = NULL;
+ c->snext = NULL;
+
clients->prev = c;
- c->next = clients;
- c->snext = stack;
- stack = clients = c;
+ } else {
+ if(clients)
+ clients->prev = c;
+ c->next = clients;
+ c->snext = stack;
+ stack = clients = c;
+ }
+
XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
XMapWindow(dpy, c->win);
if(isvisible(c))
Sólo en dwm-3.1: client.o
diff -ru dwm-3.1.orig/config.default.h dwm-3.1/config.default.h
--- dwm-3.1.orig/config.default.h 2007-01-16 11:41:35.000000000 +0100
+++ dwm-3.1/config.default.h 2007-01-17 00:57:54.000000000 +0100
@@ -29,6 +29,8 @@
{ MODKEY, XK_Tab, focusnext, { 0 } }, \
{ MODKEY|ShiftMask, XK_Tab, focusprev, { 0 } }, \
{ MODKEY, XK_Return, zoom, { 0 } }, \
+ { MODKEY, XK_a, append, { .i = 0 } }, \
+ { MODKEY, XK_e, append, { .i = 1 } }, \
{ MODKEY, XK_g, resizemaster, { .i = 15 } }, \
{ MODKEY, XK_s, resizemaster, { .i = -15 } }, \
{ MODKEY, XK_i, incnmaster, { .i = 1 } }, \
Sólo en dwm-3.1: config.h
Sólo en dwm-3.1: draw.o
Sólo en dwm-3.1: dwm
diff -ru dwm-3.1.orig/dwm.h dwm-3.1/dwm.h
--- dwm-3.1.orig/dwm.h 2007-01-16 11:41:35.000000000 +0100
+++ dwm-3.1/dwm.h 2007-01-17 00:47:52.000000000 +0100
@@ -92,6 +92,7 @@
extern char stext[256]; /* status text */
extern int bh, bmw; /* bar height, bar mode label width */
extern int screen, sx, sy, sw, sh; /* screen geometry */
+extern int apwl; /* append window list boolean */
extern int wax, way, wah, waw; /* windowarea geometry */
extern unsigned int master, nmaster; /* master percent, number of master clients */
extern unsigned int ntags, numlockmask; /* number of tags, dynamic lock mask */
@@ -160,3 +161,4 @@
extern void toggleview(Arg *arg); /* toggles the tag with arg's index (in)visible */
extern void view(Arg *arg); /* views the tag with arg's index */
extern void zoom(Arg *arg); /* zooms the focused client to master area, arg is ignored */
+extern void append(Arg *arg); /* append new windows to the client's list or not */
Sólo en dwm-3.1: event.o
diff -ru dwm-3.1.orig/main.c dwm-3.1/main.c
--- dwm-3.1.orig/main.c 2007-01-16 11:41:35.000000000 +0100
+++ dwm-3.1/main.c 2007-01-17 00:49:23.000000000 +0100
@@ -19,7 +19,7 @@
char stext[256];
Bool *seltag;
-int bh, bmw, screen, sx, sy, sw, sh, wax, way, waw, wah;
+int bh, bmw, screen, sx, sy, sw, sh, wax, way, waw, wah, apwl;
unsigned int master, nmaster, ntags, numlockmask;
Atom wmatom[WMLast], netatom[NetLast];
Bool running = True;
@@ -248,6 +248,7 @@
screen = DefaultScreen(dpy);
root = RootWindow(dpy, screen);
otherwm = False;
+ apwl = False;
XSetErrorHandler(xerrorstart);
/* this causes an error if some other window manager is running */
XSelectInput(dpy, root, SubstructureRedirectMask);
Sólo en dwm-3.1: main.o
Sólo en dwm-3.1: tag.o
Sólo en dwm-3.1: util.o
diff -ru dwm-3.1.orig/view.c dwm-3.1/view.c
--- dwm-3.1.orig/view.c 2007-01-16 11:41:35.000000000 +0100
+++ dwm-3.1/view.c 2007-01-17 00:48:31.000000000 +0100
@@ -267,3 +267,8 @@
focus(c);
arrange();
}
+
+void
+append(Arg *arg) {
+ apwl = arg->i;
+}
Sólo en dwm-3.1: view.o