sites

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

commit ccc6bfba10c2556745a021955714857c047f1bf4
parent 6cae644b1472bda2e679d05572ff823e6d5dda05
Author: Chris Down <chris@chrisdown.name>
Date:   Wed, 29 Jul 2015 21:49:08 -0700

dwm patches: Add update to attachaside that works on unfocused tags

Diffstat:
Mdwm.suckless.org/patches/attachaside.md | 13+++++++++++++
Adwm.suckless.org/patches/dwm-6.0-attachaside-tagfix.patch | 92+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 105 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/attachaside.md b/dwm.suckless.org/patches/attachaside.md @@ -43,6 +43,17 @@ area instead of always becoming the new master. It's basically an Download -------- + +### Version updated to work with tags + +The original version of attachaside does does not attach to the stack when +windows are spawned on a tag that is not currently focused. This version is +improved to also attach to the stack on unfocused tags. + +* [dwm-6.0-attachaside-tagfix.patch](dwm-6.0-attachaside-tagfix.patch) (2.9K) (20150729) + +### Original + * [dwm-6.0-attachaside.diff](dwm-6.0-attachaside.diff) (1,6K) (20140412) * [dwm-5.7.2-attachaside.diff](dwm-5.7.2-attachaside.diff) (1.1K) (20091215) * [dwm-5.6.1-attachaside.diff](dwm-5.6.1-attachaside.diff) (1.1K) (20090915) @@ -50,4 +61,6 @@ Download Authors ------- * Jerome Andrieux - `<jerome at gcu dot info>` +* Version updated to work with tags by [Chris Down](https://chrisdown.name) + (cdown) <chris@chrisdown.name> * Update to 6.0 by Vladimir Seleznev - `<me at wladmis dot org>` diff --git a/dwm.suckless.org/patches/dwm-6.0-attachaside-tagfix.patch b/dwm.suckless.org/patches/dwm-6.0-attachaside-tagfix.patch @@ -0,0 +1,92 @@ +diff --git a/dwm.c b/dwm.c +index 1d78655..452be92 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -45,7 +45,8 @@ + #define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) + #define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \ + * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy))) +-#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags])) ++#define ISVISIBLEONTAG(C, T) ((C->tags & T)) ++#define ISVISIBLE(C) ISVISIBLEONTAG(C, C->mon->tagset[C->mon->seltags]) + #define LENGTH(X) (sizeof X / sizeof X[0]) + #define MAX(A, B) ((A) > (B) ? (A) : (B)) + #define MIN(A, B) ((A) < (B) ? (A) : (B)) +@@ -160,6 +161,7 @@ static Bool applysizehints(Client *c, int *x, int *y, int *w, int *h, Bool inter + static void arrange(Monitor *m); + static void arrangemon(Monitor *m); + static void attach(Client *c); ++static void attachaside(Client *c); + static void attachstack(Client *c); + static void buttonpress(XEvent *e); + static void checkotherwm(void); +@@ -202,6 +204,7 @@ static void maprequest(XEvent *e); + static void monocle(Monitor *m); + static void motionnotify(XEvent *e); + static void movemouse(const Arg *arg); ++static Client *nexttagged(Client *c); + static Client *nexttiled(Client *c); + static void pop(Client *); + static void propertynotify(XEvent *e); +@@ -418,6 +421,17 @@ attach(Client *c) { + } + + void ++attachaside(Client *c) { ++ Client *at = nexttagged(c); ++ if(!at) { ++ attach(c); ++ return; ++ } ++ c->next = at->next; ++ at->next = c; ++} ++ ++void + attachstack(Client *c) { + c->snext = c->mon->stack; + c->mon->stack = c; +@@ -1155,7 +1169,7 @@ manage(Window w, XWindowAttributes *wa) { + c->isfloating = c->oldstate = trans != None || c->isfixed; + if(c->isfloating) + XRaiseWindow(dpy, c->win); +- attach(c); ++ attachaside(c); + attachstack(c); + XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ + setclientstate(c, NormalState); +@@ -1274,6 +1288,16 @@ movemouse(const Arg *arg) { + } + + Client * ++nexttagged(Client *c) { ++ Client *walked = c->mon->clients; ++ for(; ++ walked && (walked->isfloating || !ISVISIBLEONTAG(walked, c->tags)); ++ walked = walked->next ++ ); ++ return walked; ++} ++ ++Client * + nexttiled(Client *c) { + for(; c && (c->isfloating || !ISVISIBLE(c)); c = c->next); + return c; +@@ -1480,7 +1504,7 @@ sendmon(Client *c, Monitor *m) { + detachstack(c); + c->mon = m; + c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ +- attach(c); ++ attachaside(c); + attachstack(c); + focus(NULL); + arrange(NULL); +@@ -1900,7 +1924,7 @@ updategeom(void) { + m->clients = c->next; + detachstack(c); + c->mon = mons; +- attach(c); ++ attachaside(c); + attachstack(c); + } + if(m == selmon)