sites

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

commit 027095d43fb80f712358c5aab9093c1eec043861
parent 5a4524622d3a42437f39123988b57ce0d38166e6
Author: Shvedov Yury <shved@lvk.cs.msu.su>
Date:   Sun, 22 Jun 2014 10:33:57 +0400

Updated patch

Diffstat:
Mdwm.suckless.org/patches/dwm-6.1-taggrid.diff | 63++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 52 insertions(+), 11 deletions(-)

diff --git a/dwm.suckless.org/patches/dwm-6.1-taggrid.diff b/dwm.suckless.org/patches/dwm-6.1-taggrid.diff @@ -43,7 +43,7 @@ index 875885b..d6670dc 100644 /* button definitions */ diff --git a/dwm.c b/dwm.c -index 1bbb4b3..e211b74 100644 +index 1bbb4b3..d1b8799 100644 --- a/dwm.c +++ b/dwm.c @@ -163,6 +163,7 @@ static void detachstack(Client *c); @@ -62,25 +62,66 @@ index 1bbb4b3..e211b74 100644 static void tag(const Arg *arg); static void tagmon(const Arg *arg); static void tile(Monitor *); -@@ -702,6 +704,7 @@ drawbar(Monitor *m) { +@@ -409,11 +411,13 @@ attachstack(Client *c) { + void + buttonpress(XEvent *e) { + unsigned int i, x, click; ++ unsigned int columns; + Arg arg = {0}; + Client *c; + Monitor *m; + XButtonPressedEvent *ev = &e->xbutton; + ++ columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0); + click = ClkRootWin; + /* focus monitor if necessary */ + if((m = wintomon(ev->window)) && m != selmon) { +@@ -423,14 +427,24 @@ buttonpress(XEvent *e) { + } + if(ev->window == selmon->barwin) { + i = x = 0; ++ if (drawtagmask & DRAWCLASSICTAGS) + do + x += TEXTW(tags[i]); + while(ev->x >= x && ++i < LENGTH(tags)); +- if(i < LENGTH(tags)) { ++ if(i < LENGTH(tags) && (drawtagmask & DRAWCLASSICTAGS)) { + click = ClkTagBar; + arg.ui = 1 << i; + } +- else if(ev->x < x + blw) ++ else if(ev->x < x + columns * bh / tagrows && (drawtagmask & DRAWTAGGRID)) { ++ click = ClkTagBar; ++ i = (ev->x - x) / (bh / tagrows); ++ i = i + columns * (ev->y / (bh / tagrows)); ++ if (i >= LENGTH(tags)) { ++ i = LENGTH(tags) - 1; ++ } ++ arg.ui = 1 << i; ++ } ++ else if(ev->x < x + blw + columns * bh / tagrows) + click = ClkLtSymbol; + else if(ev->x > selmon->ww - TEXTW(stext)) + click = ClkStatusText; +@@ -702,6 +716,7 @@ drawbar(Monitor *m) { urg |= c->tags; } x = 0; -+ if (drawtagmask & DRAWCLASSICTAGS) ++ if (drawtagmask & DRAWCLASSICTAGS) for(i = 0; i < LENGTH(tags); i++) { w = TEXTW(tags[i]); drw_setscheme(drw, m->tagset[m->seltags] & 1 << i ? &scheme[SchemeSel] : &scheme[SchemeNorm]); -@@ -710,6 +713,9 @@ drawbar(Monitor *m) { +@@ -710,6 +725,9 @@ drawbar(Monitor *m) { occ & 1 << i, urg & 1 << i); x += w; } -+ if (drawtagmask & DRAWTAGGRID) { -+ drawtaggrid(m,&x,occ); -+ } ++ if (drawtagmask & DRAWTAGGRID) { ++ drawtaggrid(m,&x,occ); ++ } w = blw = TEXTW(m->ltsymbol); drw_setscheme(drw, &scheme[SchemeNorm]); drw_text(drw, x, 0, w, bh, m->ltsymbol, 0); -@@ -748,6 +754,47 @@ drawbars(void) { +@@ -748,6 +766,47 @@ drawbars(void) { for(m = mons; m; m = m->next) drawbar(m); } @@ -95,10 +136,10 @@ index 1bbb4b3..e211b74 100644 + columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0); + + /* Firstly we will fill the borders of squares */ -+ XSetForeground(drw->dpy, drw->gc, scheme[SchemeNorm].bg->rgb); ++ XSetForeground(drw->dpy, drw->gc, scheme[SchemeNorm].border->rgb); + XFillRectangle(dpy, drw->drawable, drw->gc, x, y, h*columns + 1, bh); + -+ /* We well draw LENGTH(tags) squares in tagraws raws. */ ++ /* We will draw LENGTH(tags) squares in tagraws raws. */ + for(j = 0, i= 0; j < tagrows; j++) { + x = *x_pos; + for (k = 0; k < columns && i < LENGTH(tags); k++, i++) { @@ -128,7 +169,7 @@ index 1bbb4b3..e211b74 100644 void enternotify(XEvent *e) { -@@ -1582,6 +1629,81 @@ spawn(const Arg *arg) { +@@ -1582,6 +1641,81 @@ spawn(const Arg *arg) { exit(EXIT_SUCCESS); } }