diff -r fab49062da0a config.def.h --- a/config.def.h Sat May 17 14:51:12 2008 +0100 +++ b/config.def.h Sat May 17 16:46:43 2008 +0200 @@ -39,6 +39,7 @@ { MODKEY, XK_k, focusprev, NULL }, { MODKEY, XK_h, setmfact, "-0.05" }, { MODKEY, XK_l, setmfact, "+0.05" }, + { MODKEY, XK_m, togglemax, NULL }, { MODKEY, XK_Return, zoom, NULL }, { MODKEY, XK_Tab, viewprevtag, NULL }, { MODKEY|ShiftMask, XK_c, killclient, NULL }, diff -r fab49062da0a dwm.c --- a/dwm.c Sat May 17 14:51:12 2008 +0100 +++ b/dwm.c Sat May 17 16:46:43 2008 +0200 @@ -168,6 +168,7 @@ unsigned int textw(const char *text); void togglefloating(const char *arg); void togglelayout(const char *arg); +void togglemax(const char *arg); void toggletag(const char *arg); void toggleview(const char *arg); void unban(Client *c); @@ -190,6 +191,7 @@ int screen, sx, sy, sw, sh; int (*xerrorxlib)(Display *, XErrorEvent *); int bx, by, bw, bh, blw, wx, wy, ww, wh; +int rx, ry, rw, rh; int seltags = 0; unsigned int numlockmask = 0; void (*handler[LASTEvent]) (XEvent *) = { @@ -207,10 +209,12 @@ [UnmapNotify] = unmapnotify }; Atom wmatom[WMLast], netatom[NetLast]; +Bool domax = False; Bool otherwm, readin; Bool running = True; Bool *tagset[2]; Client *clients = NULL; +Client *revert = NULL; Client *sel = NULL; Client *stack = NULL; Cursor cursor[CurLast]; @@ -259,6 +263,7 @@ arrange(void) { Client *c; + focus(NULL); for(c = clients; c; c = c->next) if(isvisible(c)) { unban(c); @@ -268,8 +273,7 @@ else ban(c); - focus(NULL); - if(lt->arrange) + if(lt->arrange && !domax) lt->arrange(); restack(); } @@ -322,10 +326,14 @@ return; } } - if((ev->x < x + blw) && ev->button == Button1) - togglelayout(NULL); + if(ev->x < x + blw) { + if(ev->button == Button1) + togglelayout(NULL); + else if(ev->button == Button3) + togglemax(NULL); + } } - else if((c = getclient(ev->window))) { + else if((c = getclient(ev->window)) && !domax) { focus(c); if(CLEANMASK(ev->state) != MODKEY) return; @@ -506,7 +514,7 @@ } if(blw > 0) { dc.w = blw; - drawtext(lt->symbol, dc.norm, False); + drawtext(lt->symbol, dc.norm, domax); x = dc.x + dc.w; } else @@ -603,7 +611,7 @@ Client *c; XCrossingEvent *ev = &e->xcrossing; - if((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root) + if(((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root) || domax) return; if((c = getclient(ev->window))) focus(c); @@ -633,6 +641,10 @@ focus(Client *c) { if(!c || (c && !isvisible(c))) for(c = stack; c && !isvisible(c); c = c->snext); + if(revert) { + resize(revert, rx, ry, rw, rh, RESIZEHINTS | revert->isfloating); + revert = NULL; + } if(sel && sel != c) { grabbuttons(sel, False); XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]); @@ -644,6 +656,15 @@ } sel = c; if(c) { + if(domax) { + rx = c->x; + ry = c->y; + rw = c->w; + rh = c->h; + XRaiseWindow(dpy, c->win); + resize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw, RESIZEHINTS); + revert = c; + } XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]); XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); } @@ -1487,6 +1508,12 @@ } void +togglemax(const char *arg) { + domax = !domax; + arrange(); +} + +void toggletag(const char *arg) { unsigned int i, j;