# HG changeset patch # User meillo@marmaro.de # Date 1212100257 -7200 # Node ID bff1012527b3ccff201b612dee23682166260f09 # Parent cdd895c163bd0a0fcb51cd6c762f833e13984b4f removed unnecessary Arg* parametersadded decnmaster diff -r cdd895c163bd -r bff1012527b3 dwm.c --- a/dwm.c Fri May 30 00:07:26 2008 +0200 +++ b/dwm.c Fri May 30 00:30:57 2008 +0200 @@ -160,7 +160,7 @@ void focus(Client *c); /* focus c, c may be NULL */ Client *getclient(Window w); /* return client of w */ Bool isprotodel(Client *c); /* returns True if c->win supports wmatom[WMDelete] */ -void killclient(Arg *arg); /* kill c nicely */ +void killclient(); /* kill c nicely */ void manage(Window w, XWindowAttributes *wa); /* manage new client */ void resize(Client *c, Bool sizehints); /* resize c*/ void updatesizehints(Client *c); /* update the size hint variables of c */ @@ -178,7 +178,7 @@ void procevent(void); /* process pending X events */ /* main.c */ -void quit(Arg *arg); /* quit dwm nicely */ +void quit(); /* quit dwm nicely */ void sendevent(Window w, Atom a, long value); /* send synthetic event to w */ int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */ @@ -186,7 +186,7 @@ void initrregs(void); /* initialize regexps of rules defined in config.h */ Client *getnext(Client *c); /* returns next visible client */ void settags(Client *c, Client *trans); /* sets tags of c */ -void toggletag(Arg *arg); /* toggles c tags with arg's index */ +void toggletag(); /* toggles c tags with arg's index */ /* util.c */ void *emallocz(unsigned int size); /* allocates zero-initialized memory, exits on error */ @@ -198,14 +198,15 @@ void dofloat(void); /* arranges all windows floating */ void dotile(void); /* arranges all windows tiled */ void domax(void); /* arranges all windows fullscreen */ -void focusnext(Arg *arg); /* focuses next visible client, arg is ignored */ -void incnmaster(Arg *arg); /* increments nmaster with arg's index value */ +void focusnext(); /* focuses next visible client, arg is ignored */ +void incnmaster(); /* increments nmaster */ +void decnmaster(); /* decrements nmaster */ Bool isvisible(Client *c); /* returns True if client is visible */ void restack(void); /* restores z layers of all clients */ -void togglefloat(Arg *arg); /* toggles focusesd client between floating/non-floating state */ -void togglemode(Arg *arg); /* toggles global arrange function (dotile/dofloat) */ +void togglefloat(); /* toggles focusesd client between floating/non-floating state */ +void togglemode(); /* toggles global arrange function (dotile/dofloat) */ void toggleview(); /* views the tag with arg's index */ -void zoom(Arg *arg); /* zooms the focused client to master area, arg is ignored */ +void zoom(); /* zooms the focused client to master area, arg is ignored */ @@ -373,7 +374,7 @@ /* end code by mitch */ void -focusnext(Arg *arg) { +focusnext() { Client *c; if(!sel) @@ -387,11 +388,21 @@ } void -incnmaster(Arg *arg) { - if((arrange == dofloat) || (nmaster + arg->i < 1) - || (wah / (nmaster + arg->i) <= 2 * BORDERPX)) +incnmaster() { + if((arrange == dofloat) || (wah / (nmaster + 1) <= 2 * BORDERPX)) return; - nmaster += arg->i; + nmaster++; + if(sel) + arrange(); + else + drawstatus(); +} + +void +decnmaster() { + if((arrange == dofloat) || (nmaster <= 1)) + return; + nmaster--; if(sel) arrange(); else @@ -440,7 +451,7 @@ } void -togglefloat(Arg *arg) { +togglefloat() { if (!sel || arrange == dofloat) return; sel->isfloat = !sel->isfloat; @@ -448,7 +459,7 @@ } void -togglemode(Arg *arg) { +togglemode() { /* only toggle between tile and max - float is just available through togglefloat */ arrange = (arrange == dotile) ? domax : dotile; if(sel) @@ -464,7 +475,7 @@ } void -zoom(Arg *arg) { +zoom() { unsigned int n; Client *c; @@ -595,7 +606,7 @@ void settags(Client *c, Client *trans) { char prop[512]; - unsigned int i, j; + unsigned int i; regmatch_t tmp; Bool matched = trans != NULL; XClassHint ch = { 0 }; @@ -631,7 +642,7 @@ } void -toggletag(Arg *arg) { +toggletag() { if(!sel) return; sel->tag = !sel->tag; @@ -877,9 +888,7 @@ keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); for(i = 0; i < len; i++) { - if(keysym == key[i].keysym - && CLEANMASK(key[i].mod) == CLEANMASK(ev->state)) - { + if(keysym == key[i].keysym && CLEANMASK(key[i].mod) == CLEANMASK(ev->state)) { if(key[i].func) key[i].func(&key[i].arg); } @@ -1082,12 +1091,13 @@ void drawstatus(void) { - int i, x; + int x; + unsigned int i; dc.x = dc.y = 0; for(i = 0; i < ntags; i++) { dc.w = textw(tags[i]); - drawtext(tags[i], ( (i == 0 && seltag || i == 1 && !seltag) ? dc.sel : dc.norm)); + drawtext(tags[i], ( ((i == 0 && seltag) || (i == 1 && !seltag)) ? dc.sel : dc.norm)); dc.x += dc.w + 1; } dc.w = bmw; @@ -1305,7 +1315,7 @@ } void -killclient(Arg *arg) { +killclient() { if(!sel) return; if(isprotodel(sel)) @@ -1688,7 +1698,7 @@ } void -quit(Arg *arg) { +quit() { readin = running = False; }