aewl
diff aewl.c @ 769:49aa8ccceefa
cleanups in domax and more
author | meillo@marmaro.de |
---|---|
date | Fri, 05 Dec 2008 21:42:47 +0100 |
parents | a1c6805aa018 |
children | 33cec4282120 |
line diff
1.1 --- a/aewl.c Fri Dec 05 21:14:50 2008 +0100 1.2 +++ b/aewl.c Fri Dec 05 21:42:47 2008 +0100 1.3 @@ -41,7 +41,6 @@ 1.4 */ 1.5 1.6 1.7 -#include "config.h" 1.8 #include <errno.h> 1.9 #include <locale.h> 1.10 #include <stdio.h> 1.11 @@ -59,6 +58,9 @@ 1.12 #include <X11/Xproto.h> 1.13 #include <X11/Xutil.h> 1.14 1.15 +#include "config.h" 1.16 + 1.17 + 1.18 /* mask shorthands, used in event.c and client.c */ 1.19 #define BUTTONMASK (ButtonPressMask | ButtonReleaseMask) 1.20 1.21 @@ -233,18 +235,21 @@ 1.22 return; 1.23 1.24 if((c->ismax = !c->ismax)) { 1.25 - c->rx = c->x; c->x = wax; 1.26 - c->ry = c->y; c->y = way; 1.27 - c->rw = c->w; c->w = waw - 2 * BORDERPX; 1.28 - c->rh = c->h; c->h = wah - 2 * BORDERPX; 1.29 - } 1.30 - else { 1.31 + c->rx = c->x; 1.32 + c->ry = c->y; 1.33 + c->rw = c->w; 1.34 + c->rh = c->h; 1.35 + c->x = wax; 1.36 + c->y = way; 1.37 + c->w = waw - 2 * BORDERPX; 1.38 + c->h = wah - 2 * BORDERPX; 1.39 + } else { 1.40 c->x = c->rx; 1.41 c->y = c->ry; 1.42 c->w = c->rw; 1.43 c->h = c->rh; 1.44 } 1.45 - resize(c, True); 1.46 + resize(c, False); 1.47 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); 1.48 } 1.49 1.50 @@ -324,11 +329,11 @@ 1.51 continue; 1.52 } 1.53 c->ismax = True; 1.54 - c->x = sx; 1.55 - c->y = bh; 1.56 - c->w = sw - 2 * BORDERPX; 1.57 - c->h = sh - bh - 2 * BORDERPX; 1.58 - resize(c, False); 1.59 + c->x = wax; 1.60 + c->y = way; 1.61 + c->w = waw - 2 * BORDERPX; 1.62 + c->h = wah - 2 * BORDERPX; 1.63 + resize(c, False); 1.64 } else { 1.65 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); 1.66 } 1.67 @@ -496,10 +501,10 @@ 1.68 spawn(const char* cmd) { 1.69 static char *shell = NULL; 1.70 1.71 - if(!shell && !(shell = getenv("SHELL"))) 1.72 - shell = "/bin/sh"; 1.73 if(!cmd) 1.74 return; 1.75 + if(!(shell = getenv("SHELL"))) 1.76 + shell = "/bin/sh"; 1.77 /* The double-fork construct avoids zombie processes and keeps the code 1.78 * clean from stupid signal handlers. */ 1.79 if(fork() == 0) {