diff -r 45ab12331044 config.default.h --- a/config.default.h Wed Aug 22 21:35:22 2007 +0200 +++ b/config.default.h Wed Aug 22 21:50:15 2007 +0200 @@ -103,6 +103,10 @@ Key keys[] = { \ { MODKEY|ShiftMask, XK_l, moveresize, "0x 0y 25w 0h" }, \ { MODKEY|ShiftMask, XK_j, moveresize, "0x 0y 0w 25h" }, \ { MODKEY|ShiftMask, XK_k, moveresize, "0x 0y 0w -25h" }, \ + { MODKEY|ControlMask|ShiftMask, XK_h, togglehorizontalmax, NULL }, \ + { MODKEY|ControlMask|ShiftMask, XK_l, togglehorizontalmax, NULL }, \ + { MODKEY|ControlMask|ShiftMask, XK_j, toggleverticalmax, NULL }, \ + { MODKEY|ControlMask|ShiftMask, XK_k, toggleverticalmax, NULL }, \ { MODKEY|ShiftMask, XK_F1, tagall, "F1" }, \ { MODKEY|ShiftMask, XK_F2, tagall, "F2" }, \ { MODKEY|ShiftMask, XK_F3, tagall, "F3" }, \ diff -r 45ab12331044 dwm.h --- a/dwm.h Wed Aug 22 21:35:22 2007 +0200 +++ b/dwm.h Wed Aug 22 21:50:16 2007 +0200 @@ -141,6 +141,8 @@ void togglebar(const char *arg); /* show void togglebar(const char *arg); /* shows/hides the bar */ void togglefloating(const char *arg); /* toggles sel between floating/tiled state */ void togglemax(const char *arg); /* toggles maximization of floating client */ +void togglehorizontalmax(const char *arg); /* toggles horizontal maximization of floating client */ +void toggleverticalmax(const char *arg); /* toggles vertical maximization of floating client */ void toggletag(const char *arg); /* toggles sel tags with arg's index */ void toggleview(const char *arg); /* toggles the tag with arg's index (in)visible */ void updatebarpos(void); /* updates the bar position */ diff -r 45ab12331044 screen.c --- a/screen.c Wed Aug 22 21:35:22 2007 +0200 +++ b/screen.c Wed Aug 22 21:50:16 2007 +0200 @@ -293,7 +293,7 @@ togglefloating(const char *arg) { } void -togglemax(const char *arg) { +maximize(int x, int y, int w, int h) { XEvent ev; if(!sel || (!isfloating() && !sel->isfloating) || sel->isfixed) @@ -303,12 +303,29 @@ togglemax(const char *arg) { sel->ry = sel->y; sel->rw = sel->w; sel->rh = sel->h; - resize(sel, wax, way, waw - 2 * sel->border, wah - 2 * sel->border, True); + resize(sel, x, y, w, h, True); } else resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True); drawstatus(); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); +} + +void +togglemax(const char *arg) { + maximize(wax, way, waw - 2 * BORDERPX, wah - 2 * BORDERPX); +} + +void +toggleverticalmax(const char *arg) { + if (sel) + maximize(sel->x, way, sel->w, wah - 2 * BORDERPX); +} + +void +togglehorizontalmax(const char *arg) { + if (sel) + maximize(wax, sel->y, waw - 2 * BORDERPX, sel->h); } void