Mercurial > aewl
changeset 769:49aa8ccceefa
cleanups in domax and more
author | meillo@marmaro.de |
---|---|
date | Fri, 05 Dec 2008 21:42:47 +0100 (2008-12-05) |
parents | a1c6805aa018 |
children | 33cec4282120 |
files | aewl.c config.h |
diffstat | 2 files changed, 25 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/aewl.c Fri Dec 05 21:14:50 2008 +0100 +++ b/aewl.c Fri Dec 05 21:42:47 2008 +0100 @@ -41,7 +41,6 @@ */ -#include "config.h" #include <errno.h> #include <locale.h> #include <stdio.h> @@ -59,6 +58,9 @@ #include <X11/Xproto.h> #include <X11/Xutil.h> +#include "config.h" + + /* mask shorthands, used in event.c and client.c */ #define BUTTONMASK (ButtonPressMask | ButtonReleaseMask) @@ -233,18 +235,21 @@ return; if((c->ismax = !c->ismax)) { - c->rx = c->x; c->x = wax; - c->ry = c->y; c->y = way; - c->rw = c->w; c->w = waw - 2 * BORDERPX; - c->rh = c->h; c->h = wah - 2 * BORDERPX; - } - else { + c->rx = c->x; + c->ry = c->y; + c->rw = c->w; + c->rh = c->h; + c->x = wax; + c->y = way; + c->w = waw - 2 * BORDERPX; + c->h = wah - 2 * BORDERPX; + } else { c->x = c->rx; c->y = c->ry; c->w = c->rw; c->h = c->rh; } - resize(c, True); + resize(c, False); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); } @@ -324,11 +329,11 @@ continue; } c->ismax = True; - c->x = sx; - c->y = bh; - c->w = sw - 2 * BORDERPX; - c->h = sh - bh - 2 * BORDERPX; - resize(c, False); + c->x = wax; + c->y = way; + c->w = waw - 2 * BORDERPX; + c->h = wah - 2 * BORDERPX; + resize(c, False); } else { XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); } @@ -496,10 +501,10 @@ spawn(const char* cmd) { static char *shell = NULL; - if(!shell && !(shell = getenv("SHELL"))) - shell = "/bin/sh"; if(!cmd) return; + if(!(shell = getenv("SHELL"))) + shell = "/bin/sh"; /* The double-fork construct avoids zombie processes and keeps the code * clean from stupid signal handlers. */ if(fork() == 0) {
--- a/config.h Fri Dec 05 21:14:50 2008 +0100 +++ b/config.h Fri Dec 05 21:42:47 2008 +0100 @@ -44,10 +44,9 @@ #define RULES \ static Rule rule[] = { \ /* class, instance, title, tag (1=tag/0=untag/-1=curr), isfloat */ \ - { "URxvt", NULL, NULL, 0, False }, \ - { "urxvt", NULL, NULL, 0, False }, \ - { "MPlayer", NULL, NULL, -1, True }, \ - { NULL, "qiv", NULL, -1, False }, \ - { "Gimp", NULL, NULL, 1, True }, \ - { "", "", "", 1, False }, \ + { "URxvt", NULL, NULL, 0, False }, \ + { "MPlayer", NULL, NULL, -1, True }, \ + { NULL, "qiv", NULL, -1, False }, \ + { "Gimp", NULL, NULL, 1, True }, \ + { "", "", "", 1, False }, \ };