aewl

changeset 756:bff1012527b3

removed unnecessary Arg* parametersadded decnmaster
author meillo@marmaro.de
date Fri, 30 May 2008 00:30:57 +0200
parents cdd895c163bd
children 427608ef0687
files dwm.c
diffstat 1 files changed, 35 insertions(+), 25 deletions(-) [+]
line diff
     1.1 --- a/dwm.c	Fri May 30 00:07:26 2008 +0200
     1.2 +++ b/dwm.c	Fri May 30 00:30:57 2008 +0200
     1.3 @@ -160,7 +160,7 @@
     1.4  void focus(Client *c);			/* focus c, c may be NULL */
     1.5  Client *getclient(Window w);		/* return client of w */
     1.6  Bool isprotodel(Client *c);		/* returns True if c->win supports wmatom[WMDelete] */
     1.7 -void killclient(Arg *arg);		/* kill c nicely */
     1.8 +void killclient();		/* kill c nicely */
     1.9  void manage(Window w, XWindowAttributes *wa);	/* manage new client */
    1.10  void resize(Client *c, Bool sizehints);	/* resize c*/
    1.11  void updatesizehints(Client *c);		/* update the size hint variables of c */
    1.12 @@ -178,7 +178,7 @@
    1.13  void procevent(void);			/* process pending X events */
    1.14  
    1.15  /* main.c */
    1.16 -void quit(Arg *arg);			/* quit dwm nicely */
    1.17 +void quit();			/* quit dwm nicely */
    1.18  void sendevent(Window w, Atom a, long value);	/* send synthetic event to w */
    1.19  int xerror(Display *dsply, XErrorEvent *ee);	/* dwm's X error handler */
    1.20  
    1.21 @@ -186,7 +186,7 @@
    1.22  void initrregs(void);			/* initialize regexps of rules defined in config.h */
    1.23  Client *getnext(Client *c);		/* returns next visible client */
    1.24  void settags(Client *c, Client *trans);	/* sets tags of c */
    1.25 -void toggletag(Arg *arg);		/* toggles c tags with arg's index */
    1.26 +void toggletag();		/* toggles c tags with arg's index */
    1.27  
    1.28  /* util.c */
    1.29  void *emallocz(unsigned int size);	/* allocates zero-initialized memory, exits on error */
    1.30 @@ -198,14 +198,15 @@
    1.31  void dofloat(void);			/* arranges all windows floating */
    1.32  void dotile(void);			/* arranges all windows tiled */
    1.33  void domax(void);            /* arranges all windows fullscreen */
    1.34 -void focusnext(Arg *arg);		/* focuses next visible client, arg is ignored  */
    1.35 -void incnmaster(Arg *arg);		/* increments nmaster with arg's index value */
    1.36 +void focusnext();		/* focuses next visible client, arg is ignored  */
    1.37 +void incnmaster();		/* increments nmaster */
    1.38 +void decnmaster();		/* decrements nmaster */
    1.39  Bool isvisible(Client *c);		/* returns True if client is visible */
    1.40  void restack(void);			/* restores z layers of all clients */
    1.41 -void togglefloat(Arg *arg);		/* toggles focusesd client between floating/non-floating state */
    1.42 -void togglemode(Arg *arg);		/* toggles global arrange function (dotile/dofloat) */
    1.43 +void togglefloat();		/* toggles focusesd client between floating/non-floating state */
    1.44 +void togglemode();		/* toggles global arrange function (dotile/dofloat) */
    1.45  void toggleview();			/* views the tag with arg's index */
    1.46 -void zoom(Arg *arg);			/* zooms the focused client to master area, arg is ignored */
    1.47 +void zoom();			/* zooms the focused client to master area, arg is ignored */
    1.48  
    1.49  
    1.50  
    1.51 @@ -373,7 +374,7 @@
    1.52  /* end code by mitch */
    1.53  
    1.54  void
    1.55 -focusnext(Arg *arg) {
    1.56 +focusnext() {
    1.57  	Client *c;
    1.58  
    1.59  	if(!sel)
    1.60 @@ -387,11 +388,21 @@
    1.61  }
    1.62  
    1.63  void
    1.64 -incnmaster(Arg *arg) {
    1.65 -	if((arrange == dofloat) || (nmaster + arg->i < 1)
    1.66 -		|| (wah / (nmaster + arg->i) <= 2 * BORDERPX))
    1.67 +incnmaster() {
    1.68 +	if((arrange == dofloat) || (wah / (nmaster + 1) <= 2 * BORDERPX))
    1.69  		return;
    1.70 -	nmaster += arg->i;
    1.71 +	nmaster++;
    1.72 +	if(sel)
    1.73 +		arrange();
    1.74 +	else
    1.75 +		drawstatus();
    1.76 +}
    1.77 +
    1.78 +void
    1.79 +decnmaster() {
    1.80 +	if((arrange == dofloat) || (nmaster <= 1))
    1.81 +		return;
    1.82 +	nmaster--;
    1.83  	if(sel)
    1.84  		arrange();
    1.85  	else
    1.86 @@ -440,7 +451,7 @@
    1.87  }
    1.88  
    1.89  void
    1.90 -togglefloat(Arg *arg) {
    1.91 +togglefloat() {
    1.92  	if (!sel || arrange == dofloat)
    1.93  		return;
    1.94  	sel->isfloat = !sel->isfloat;
    1.95 @@ -448,7 +459,7 @@
    1.96  }
    1.97  
    1.98  void
    1.99 -togglemode(Arg *arg) {
   1.100 +togglemode() {
   1.101    /* only toggle between tile and max - float is just available through togglefloat */
   1.102    arrange = (arrange == dotile) ? domax : dotile;
   1.103  	if(sel)
   1.104 @@ -464,7 +475,7 @@
   1.105  }
   1.106  
   1.107  void
   1.108 -zoom(Arg *arg) {
   1.109 +zoom() {
   1.110  	unsigned int n;
   1.111  	Client *c;
   1.112  
   1.113 @@ -595,7 +606,7 @@
   1.114  void
   1.115  settags(Client *c, Client *trans) {
   1.116  	char prop[512];
   1.117 -	unsigned int i, j;
   1.118 +	unsigned int i;
   1.119  	regmatch_t tmp;
   1.120  	Bool matched = trans != NULL;
   1.121  	XClassHint ch = { 0 };
   1.122 @@ -631,7 +642,7 @@
   1.123  }
   1.124  
   1.125  void
   1.126 -toggletag(Arg *arg) {
   1.127 +toggletag() {
   1.128  	if(!sel)
   1.129  		return;
   1.130  	sel->tag = !sel->tag;
   1.131 @@ -877,9 +888,7 @@
   1.132  
   1.133  	keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
   1.134  	for(i = 0; i < len; i++) {
   1.135 -		if(keysym == key[i].keysym
   1.136 -			&& CLEANMASK(key[i].mod) == CLEANMASK(ev->state))
   1.137 -		{
   1.138 +		if(keysym == key[i].keysym && CLEANMASK(key[i].mod) == CLEANMASK(ev->state)) {
   1.139  			if(key[i].func)
   1.140  				key[i].func(&key[i].arg);
   1.141  		}
   1.142 @@ -1082,12 +1091,13 @@
   1.143  
   1.144  void
   1.145  drawstatus(void) {
   1.146 -	int i, x;
   1.147 +	int x;
   1.148 +	unsigned int i;
   1.149  
   1.150  	dc.x = dc.y = 0;
   1.151  	for(i = 0; i < ntags; i++) {
   1.152  		dc.w = textw(tags[i]);
   1.153 -		drawtext(tags[i], ( (i == 0 && seltag || i == 1 && !seltag) ? dc.sel : dc.norm));
   1.154 +		drawtext(tags[i], ( ((i == 0 && seltag) || (i == 1 && !seltag)) ? dc.sel : dc.norm));
   1.155  		dc.x += dc.w + 1;
   1.156  	}
   1.157  	dc.w = bmw;
   1.158 @@ -1305,7 +1315,7 @@
   1.159  }
   1.160  
   1.161  void
   1.162 -killclient(Arg *arg) {
   1.163 +killclient() {
   1.164  	if(!sel)
   1.165  		return;
   1.166  	if(isprotodel(sel))
   1.167 @@ -1688,7 +1698,7 @@
   1.168  }
   1.169  
   1.170  void
   1.171 -quit(Arg *arg) {
   1.172 +quit() {
   1.173  	readin = running = False;
   1.174  }
   1.175