*** dwm.h.000 2006-08-02 10:52:29.000000000 -0400 --- dwm.h 2006-08-06 21:38:16.000000000 -0400 *************** *** 13,18 **** --- 13,19 ---- typedef union Arg Arg; typedef struct Client Client; + typedef struct Tag Tag; typedef struct DC DC; typedef struct Fnt Fnt; *************** *** 60,79 **** long flags; unsigned int border; Bool isfloat; - Bool ismax; Client *next; Client *prev; Window win; Window title; }; ! extern char *tags[TLast], stext[1024]; extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw; extern void (*handler[LASTEvent])(XEvent *); extern void (*arrange)(Arg *); extern Atom wmatom[WMLast], netatom[NetLast]; extern Bool running, issel; extern Client *clients, *sel; extern Cursor cursor[CurLast]; extern DC dc; extern Display *dpy; --- 61,85 ---- long flags; unsigned int border; Bool isfloat; Client *next; Client *prev; Window win; Window title; }; ! struct Tag { ! char *name; ! Bool ismax; ! }; ! ! extern char stext[1024]; extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw; extern void (*handler[LASTEvent])(XEvent *); extern void (*arrange)(Arg *); extern Atom wmatom[WMLast], netatom[NetLast]; extern Bool running, issel; extern Client *clients, *sel; + extern Tag tags[TLast]; extern Cursor cursor[CurLast]; extern DC dc; extern Display *dpy; *** client.c.000 2006-08-02 10:52:29.000000000 -0400 --- client.c 2006-08-06 21:38:52.000000000 -0400 *************** *** 69,77 **** if(!sel) return; - if(sel->ismax) - togglemax(NULL); - if(!(c = getnext(sel->next))) c = getnext(clients); if(c) { --- 69,74 ---- *************** *** 88,96 **** if(!sel) return; - if(sel->ismax) - togglemax(NULL); - if(!(c = getprev(sel->prev))) { for(c = clients; c && c->next; c = c->next); c = getprev(c); --- 85,90 ---- *************** *** 378,410 **** void togglemax(Arg *arg) { ! int ox, oy, ow, oh; ! XEvent ev; ! if(!sel) ! return; ! ! if((sel->ismax = !sel->ismax)) { ! ox = sel->x; ! oy = sel->y; ! ow = sel->w; ! oh = sel->h; ! sel->x = sx; ! sel->y = sy + bh; ! sel->w = sw - 2; ! sel->h = sh - 2 - bh; ! ! higher(sel); ! resize(sel, False, TopLeft); ! ! sel->x = ox; ! sel->y = oy; ! sel->w = ow; ! sel->h = oh; ! } ! else ! resize(sel, False, TopLeft); ! while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); } void --- 372,381 ---- void togglemax(Arg *arg) { ! tags[tsel].ismax = !tags[tsel].ismax; ! arrange(NULL); if(!sel) ! focus(sel); } void *** draw.c.000 2006-08-02 10:52:29.000000000 -0400 --- draw.c 2006-08-06 21:39:15.000000000 -0400 *************** *** 116,126 **** dc.w = 0; for(i = 0; i < TLast; i++) { dc.x += dc.w; ! dc.w = textw(tags[i]); if(istile) ! drawtext(tags[i], (i == tsel), True); else ! drawtext(tags[i], (i != tsel), True); } x = dc.x + dc.w; dc.w = textw(stext); --- 116,126 ---- dc.w = 0; for(i = 0; i < TLast; i++) { dc.x += dc.w; ! dc.w = textw(tags[i].name); if(istile) ! drawtext(tags[i].name, (i == tsel), True); else ! drawtext(tags[i].name, (i != tsel), True); } x = dc.x + dc.w; dc.w = textw(stext); *** event.c.000 2006-08-02 10:52:29.000000000 -0400 --- event.c 2006-08-06 21:39:29.000000000 -0400 *************** *** 106,112 **** default: x = 0; for(a.i = 0; a.i < TLast; a.i++) { ! x += textw(tags[a.i]); if(ev->x < x) { view(&a); break; --- 106,112 ---- default: x = 0; for(a.i = 0; a.i < TLast; a.i++) { ! x += textw(tags[a.i].name); if(ev->x < x) { view(&a); break; *************** *** 127,133 **** default: break; case Button1: ! if(!c->ismax && (arrange == dofloat || c->isfloat)) { higher(c); movemouse(c); } --- 127,133 ---- default: break; case Button1: ! if(arrange == dofloat || c->isfloat) { higher(c); movemouse(c); } *************** *** 136,142 **** lower(c); break; case Button3: ! if(!c->ismax && (arrange == dofloat || c->isfloat)) { higher(c); resizemouse(c); } --- 136,142 ---- lower(c); break; case Button3: ! if(arrange == dofloat || c->isfloat) { higher(c); resizemouse(c); } *** tag.c.000 2006-08-02 10:52:29.000000000 -0400 --- tag.c 2006-08-06 21:50:44.000000000 -0400 *************** *** 30,36 **** if(!sel) return; ! sel->tags[arg->i] = tags[arg->i]; arrange(NULL); } --- 30,36 ---- if(!sel) return; ! sel->tags[arg->i] = tags[arg->i].name; arrange(NULL); } *************** *** 40,46 **** Client *c; for(c = clients; c; c = c->next) { - c->ismax = False; if(c->tags[tsel]) { resize(c, True, TopLeft); } --- 40,45 ---- *************** *** 75,88 **** h = sh - bh; for(i = 0, c = clients; c; c = c->next) { - c->ismax = False; if(c->tags[tsel]) { if(c->isfloat) { higher(c); resize(c, True, TopLeft); continue; } ! if(n == 1) { c->x = sx; c->y = sy + bh; c->w = sw - 2; --- 74,86 ---- h = sh - bh; for(i = 0, c = clients; c; c = c->next) { if(c->tags[tsel]) { if(c->isfloat) { higher(c); resize(c, True, TopLeft); continue; } ! if(n == 1 || tags[tsel].ismax) { c->x = sx; c->y = sy + bh; c->w = sw - 2; *************** *** 184,190 **** XFree(ch.res_name); } if(!matched) ! c->tags[tsel] = tags[tsel]; } void --- 182,188 ---- XFree(ch.res_name); } if(!matched) ! c->tags[tsel] = tags[tsel].name; } void *** config.default.h.000 2006-08-02 10:52:29.000000000 -0400 --- config.default.h 2006-08-06 21:54:36.000000000 -0400 *************** *** 5,16 **** enum { Tfnord, Tdev, Tnet, Twork, Tmisc, TLast }; #define TAGS \ ! char *tags[TLast] = { \ ! [Tfnord] = "fnord", \ ! [Tdev] = "dev", \ ! [Tnet] = "net", \ ! [Twork] = "work", \ ! [Tmisc] = "misc", \ }; #define DEFMODE dotile /* dofloat */ --- 5,16 ---- enum { Tfnord, Tdev, Tnet, Twork, Tmisc, TLast }; #define TAGS \ ! Tag tags[TLast] = { \ ! "fnord", False, \ ! "dev", False, \ ! "net", False, \ ! "work", False, \ ! "misc", False, \ }; #define DEFMODE dotile /* dofloat */