Posted by pnd4 on Fri 18th Jan 08:35 (modification of post by view diff)
download | new post
- ## PND4 - o1.18.13
- #
- # Patch for dwm-6.0, enables independent 'tagsets' for multiple-display
- # support. Incompatible with most perftag patches it seems.
- #
- --- dwm-6.0-vanilla/dwm-6.0/dwm.c-2011-12-19 07:02:46.000000000 -0800
- +++ dwm-6.0/dwm.c-2013-01-17 18:48:26.496552869 -0800
- -52,7 +52,7 @@
- #define MOUSEMASK (BUTTONMASK|PointerMotionMask)
- #define WIDTH(X) ((X)->w + 2 * (X)->bw)
- #define HEIGHT(X) ((X)->h + 2 * (X)->bw)
- -#define TAGMASK ((1 << LENGTH(tags)) - 1)
- +#define TAGMASK ((1 << LENGTH(tags[0])) - 1)
- #define TEXTW(X) (textnw(X, strlen(X)) + dc.font.height)
- .
- /* enums */
- -288,7 +288,7 @@
- #include "config.h"
- .
- /* compile-time check if all tags fit into an unsigned int bit array. */
- -struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
- +struct NumTags { char limitexceeded[LENGTH(tags[0]) > 31 ? -1 : 1]; };
- .
- /* function implementations */
- void
- -441,9 +441,9 @@
- -if(ev->window == selmon->barwin) {
- -->i = x = 0;
- -->do
- --->->x += TEXTW(tags[i]);
- --->while(ev->x >= x && ++i < LENGTH(tags));
- --->if(i < LENGTH(tags)) {
- +-->->x += TEXTW(tags[selmon->num][i]);
- +-->while(ev->x >= x && ++i < LENGTH(tags[0]));
- +-->if(i < LENGTH(tags[0])) {
- -->->click = ClkTagBar;
- -->->arg.ui = 1 << i;
- -->}
- -728,10 +728,10 @@
- -->->urg |= c->tags;
- -}
- -dc.x = 0;
- --for(i = 0; i < LENGTH(tags); i++) {
- --->dc.w = TEXTW(tags[i]);
- +-for(i = 0; i < LENGTH(tags[0]); i++) {
- +-->dc.w = TEXTW(tags[m->num][i]);
- -->col = m->tagset[m->seltags] & 1 << i ? dc.sel : dc.norm;
- --->drawtext(tags[i], col, urg & 1 << i);
- +-->drawtext(tags[m->num][i], col, urg & 1 << i);
- -->drawsquare(m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
- --> occ & 1 << i, urg & 1 << i, col);
- -->dc.x += dc.w;
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.