sites

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

commit bb519c03b36d4fae1cbcbfdcb221d6e55e50a24b
parent 4352b7d8a71dd82c818a63f95181539821425a00
Author: Rob Pilling <my name at gmail dot com>
Date:   Fri,  4 Jun 2010 18:27:18 +0100

Added Julien Pecqueur's pertag diff against dwm-5.8.2
Diffstat:
Adwm.suckless.org/patches/dwm-5.8.2-pertag.diff | 184+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mdwm.suckless.org/patches/pertag.md | 2++
2 files changed, 186 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/dwm-5.8.2-pertag.diff b/dwm.suckless.org/patches/dwm-5.8.2-pertag.diff @@ -0,0 +1,184 @@ +diff -r cb309a6cea4b dwm.c +--- a/dwm.c Wed Jun 02 18:24:24 2010 +0200 ++++ b/dwm.c Thu Jun 03 18:47:50 2010 +0200 +@@ -121,26 +121,6 @@ + void (*arrange)(Monitor *); + } Layout; + +-struct Monitor { +- char ltsymbol[16]; +- float mfact; +- int num; +- int by; /* bar geometry */ +- int mx, my, mw, mh; /* screen size */ +- int wx, wy, ww, wh; /* window area */ +- unsigned int seltags; +- unsigned int sellt; +- unsigned int tagset[2]; +- Bool showbar; +- Bool topbar; +- Client *clients; +- Client *sel; +- Client *stack; +- Monitor *next; +- Window barwin; +- const Layout *lt[2]; +-}; +- + typedef struct { + const char *class; + const char *instance; +@@ -275,6 +255,31 @@ + /* configuration, allows nested code to access above variables */ + #include "config.h" + ++struct Monitor { ++ char ltsymbol[16]; ++ float mfact; ++ int num; ++ int by; /* bar geometry */ ++ int mx, my, mw, mh; /* screen size */ ++ int wx, wy, ww, wh; /* window area */ ++ unsigned int seltags; ++ unsigned int sellt; ++ unsigned int tagset[2]; ++ Bool showbar; ++ Bool topbar; ++ Client *clients; ++ Client *sel; ++ Client *stack; ++ Monitor *next; ++ Window barwin; ++ const Layout *lt[2]; ++ int curtag; ++ int prevtag; ++ const Layout *lts[LENGTH(tags) + 1]; ++ double mfacts[LENGTH(tags) + 1]; ++ Bool showbars[LENGTH(tags) + 1]; ++}; ++ + /* compile-time check if all tags fit into an unsigned int bit array. */ + struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; }; + +@@ -1467,7 +1472,7 @@ + if(!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) + selmon->sellt ^= 1; + if(arg && arg->v) +- selmon->lt[selmon->sellt] = (Layout *)arg->v; ++ selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag] = (Layout *)arg->v; + strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); + if(selmon->sel) + arrange(selmon); +@@ -1485,13 +1490,15 @@ + f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; + if(f < 0.1 || f > 0.9) + return; +- selmon->mfact = f; ++ selmon->mfact = selmon->mfacts[selmon->curtag] = f; + arrange(selmon); + } + + void + setup(void) { + XSetWindowAttributes wa; ++ Monitor *m; ++ unsigned int i; + + /* clean up any zombies immediately */ + sigchld(0); +@@ -1527,7 +1534,27 @@ + XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); + if(!dc.font.set) + XSetFont(dpy, dc.gc, dc.font.xfont->fid); ++ /* init tags */ ++ for(m = mons; m; m = m->next) ++ m->curtag = m->prevtag = 1; ++ /* init mfacts */ ++ for(m = mons; m; m = m->next) { ++ for(i=0; i < LENGTH(tags) + 1 ; i++) { ++ m->mfacts[i] = m->mfact; ++ } ++ } ++ /* init layouts */ ++ for(m = mons; m; m = m->next) { ++ for(i=0; i < LENGTH(tags) + 1; i++) { ++ m->lts[i] = &layouts[0]; ++ } ++ } + /* init bars */ ++ for(m = mons; m; m = m->next) { ++ for(i=0; i < LENGTH(tags) + 1; i++) { ++ m->showbars[i] = m->showbar; ++ } ++ } + updatebars(); + updatestatus(); + /* EWMH support per view */ +@@ -1638,7 +1665,7 @@ + + void + togglebar(const Arg *arg) { +- selmon->showbar = !selmon->showbar; ++ selmon->showbar = selmon->showbars[selmon->curtag] = !selmon->showbar; + updatebarpos(selmon); + XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh); + arrange(selmon); +@@ -1658,12 +1685,27 @@ + void + toggletag(const Arg *arg) { + unsigned int newtags; ++ unsigned int i; + + if(!selmon->sel) + return; + newtags = selmon->sel->tags ^ (arg->ui & TAGMASK); + if(newtags) { + selmon->sel->tags = newtags; ++ if(newtags == ~0) { ++ selmon->prevtag = selmon->curtag; ++ selmon->curtag = 0; ++ } ++ if(!(newtags & 1 << (selmon->curtag - 1))) { ++ selmon->prevtag = selmon->curtag; ++ for (i=0; !(newtags & 1 << i); i++); ++ selmon->curtag = i + 1; ++ } ++ selmon->sel->tags = newtags; ++ selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag]; ++ selmon->mfact = selmon->mfacts[selmon->curtag]; ++ if (selmon->showbar != selmon->showbars[selmon->curtag]) ++ togglebar(NULL); + arrange(selmon); + } + } +@@ -1930,11 +1972,29 @@ + + void + view(const Arg *arg) { ++ unsigned int i; ++ + if((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) + return; + selmon->seltags ^= 1; /* toggle sel tagset */ +- if(arg->ui & TAGMASK) ++ if(arg->ui & TAGMASK) { + selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; ++ selmon->prevtag = selmon->curtag; ++ if(arg->ui == ~0) ++ selmon->curtag = 0; ++ else { ++ for (i=0; !(arg->ui & 1 << i); i++); ++ selmon->curtag = i + 1; ++ } ++ } else { ++ selmon->prevtag= selmon->curtag ^ selmon->prevtag; ++ selmon->curtag^= selmon->prevtag; ++ selmon->prevtag= selmon->curtag ^ selmon->prevtag; ++ } ++ selmon->lt[selmon->sellt]= selmon->lts[selmon->curtag]; ++ selmon->mfact = selmon->mfacts[selmon->curtag]; ++ if(selmon->showbar != selmon->showbars[selmon->curtag]) ++ togglebar(NULL); + arrange(selmon); + } + diff --git a/dwm.suckless.org/patches/pertag.md b/dwm.suckless.org/patches/pertag.md @@ -6,6 +6,7 @@ More general approach of [taglayouts patch][3]. The patch keeps layout, mwfact, installed) per tag. ## Download ## + * [dwm-5.8.2-pertag.diff][10] * [dwm-5.7.2-pertag.diff][9] * [dwm-pertag-5.6.1.diff][8] * [dwm-5.4-pertag.diff][7] @@ -31,3 +32,4 @@ installed) per tag. [7]: http://dwm.suckless.org/patches/historical/dwm-5.4-pertag.diff [8]: http://dwm.suckless.org/patches/dwm-pertag-5.6.1.diff [9]: http://dwm.suckless.org/patches/dwm-5.7.2-pertag.diff +[10]: http://dwm.suckless.org/patches/dwm-5.8.2-pertag.diff