sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit f38d1e01799ecf3a917ad105ff9ce4ba93e298bc
parent 37ca2eeeb926fed1d79ebffb8bd60a119752fd81
Author: Jan Christoph Ebersbach <jceb@e-jc.de>
Date:   Tue, 14 Feb 2012 20:57:17 +0100

update attachabove patch for dwm 6.0
Diffstat:
Mdwm.suckless.org/patches/attachabove.md | 1+
Adwm.suckless.org/patches/dwm-6.0-attachabove.diff | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/attachabove.md b/dwm.suckless.org/patches/attachabove.md @@ -8,6 +8,7 @@ always becoming the new master) - basically how Xmonad does it. Download -------- +* [dwm-6.0-attachabove.diff](dwm-6.0-attachabove.diff) (1.6K) (20120214) * [dwm-5.6.1-attachabove.diff](dwm-5.6.1-attachabove.diff) (1.1K) (20090817) Author diff --git a/dwm.suckless.org/patches/dwm-6.0-attachabove.diff b/dwm.suckless.org/patches/dwm-6.0-attachabove.diff @@ -0,0 +1,62 @@ +URL: http://dwm.suckless.org/patches/attachabove +attachabove makes new clients attach above the selected client (instead of +always becoming the new master) – basically how Xmonad does it. + +diff -r 6f54bd1ef439 dwm.c +--- a/dwm.c Wed Jan 04 13:30:12 2012 +0100 ++++ b/dwm.c Sun Feb 12 09:32:42 2012 +0100 +@@ -160,6 +160,7 @@ + static void arrange(Monitor *m); + static void arrangemon(Monitor *m); + static void attach(Client *c); ++static void attachabove(Client *c); + static void attachstack(Client *c); + static void buttonpress(XEvent *e); + static void checkotherwm(void); +@@ -418,6 +419,19 @@ + } + + void ++attachabove(Client *c) { ++ if(c->mon->sel == NULL || c->mon->sel == c->mon->clients || c->mon->sel->isfloating) { ++ attach(c); ++ return; ++ } ++ ++ Client *at; ++ for(at = c->mon->clients; at->next != c->mon->sel; at = at->next); ++ c->next = at->next; ++ at->next = c; ++} ++ ++void + attachstack(Client *c) { + c->snext = c->mon->stack; + c->mon->stack = c; +@@ -1155,7 +1169,7 @@ + c->isfloating = c->oldstate = trans != None || c->isfixed; + if(c->isfloating) + XRaiseWindow(dpy, c->win); +- attach(c); ++ attachabove(c); + attachstack(c); + XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ + setclientstate(c, NormalState); +@@ -1480,7 +1494,7 @@ + detachstack(c); + c->mon = m; + c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ +- attach(c); ++ attachabove(c); + attachstack(c); + focus(NULL); + arrange(NULL); +@@ -1900,7 +1914,7 @@ + m->clients = c->next; + detachstack(c); + c->mon = mons; +- attach(c); ++ attachabove(c); + attachstack(c); + } + if(m == selmon)