dwm-meillo
changeset 502:9aa3d06199cb
applied Jukkas patch
author | Anselm R. Garbe <arg@10kloc.org> |
---|---|
date | Thu, 28 Sep 2006 14:03:39 +0200 |
parents | a067c5550e6f |
children | 491eebbe7a64 |
files | client.c dwm.h view.c |
diffstat | 3 files changed, 19 insertions(+), 17 deletions(-) [+] |
line diff
1.1 --- a/client.c Wed Sep 27 17:21:25 2006 +0200 1.2 +++ b/client.c Thu Sep 28 14:03:39 2006 +0200 1.3 @@ -214,11 +214,11 @@ 1.4 c->border = 0; 1.5 updatesize(c); 1.6 1.7 - if(c->x + c->w + 2 > sw) 1.8 - c->x = sw - c->w - 2; 1.9 + if(c->x + c->w + 2 * BORDERPX > sw) 1.10 + c->x = sw - c->w - 2 * BORDERPX; 1.11 if(c->x < 0) 1.12 c->x = 0; 1.13 - if(c->y + c->h + 2 > sh) 1.14 + if(c->y + c->h + 2 * BORDERPX > sh) 1.15 c->y = sh - c->h - 2; 1.16 if(c->h != sh && c->y < bh) 1.17 c->y = bh; 1.18 @@ -302,7 +302,7 @@ 1.19 if(c->w == sw && c->h == sh) 1.20 wc.border_width = 0; 1.21 else 1.22 - wc.border_width = 1; 1.23 + wc.border_width = BORDERPX; 1.24 XConfigureWindow(dpy, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc); 1.25 configure(c); 1.26 XSync(dpy, False); 1.27 @@ -312,8 +312,8 @@ 1.28 resizetitle(Client *c) { 1.29 c->tw = textw(c->name); 1.30 if(c->tw > c->w) 1.31 - c->tw = c->w + 2; 1.32 - c->tx = c->x + c->w - c->tw + 2; 1.33 + c->tw = c->w + 2 * BORDERPX; 1.34 + c->tx = c->x + c->w - c->tw + 2 * BORDERPX; 1.35 c->ty = c->y; 1.36 if(isvisible(c)) 1.37 XMoveResizeWindow(dpy, c->twin, c->tx, c->ty, c->tw, c->th);
2.1 --- a/dwm.h Wed Sep 27 17:21:25 2006 +0200 2.2 +++ b/dwm.h Thu Sep 28 14:03:39 2006 +0200 2.3 @@ -38,6 +38,8 @@ 2.4 /* mask shorthands, used in event.c and client.c */ 2.5 #define BUTTONMASK (ButtonPressMask | ButtonReleaseMask) 2.6 #define MOUSEMASK (BUTTONMASK | PointerMotionMask) 2.7 +/* other stuff used in different places */ 2.8 +#define BORDERPX 1 2.9 #define PROTODELWIN 1 2.10 2.11 enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */
3.1 --- a/view.c Wed Sep 27 17:21:25 2006 +0200 3.2 +++ b/view.c Thu Sep 28 14:03:39 2006 +0200 3.3 @@ -49,8 +49,8 @@ 3.4 if((c->ismax = !c->ismax)) { 3.5 c->rx = c->x; c->x = sx; 3.6 c->ry = c->y; c->y = bh; 3.7 - c->rw = c->w; c->w = sw; 3.8 - c->rh = c->h; c->h = sh - bh - 2; 3.9 + c->rw = c->w; c->w = sw - 2 * BORDERPX; 3.10 + c->rh = c->h; c->h = sh - bh - 2 * BORDERPX; 3.11 } 3.12 else { 3.13 c->x = c->rx; 3.14 @@ -119,29 +119,29 @@ 3.15 if(n == 1) { 3.16 c->x = sx; 3.17 c->y = sy + bh; 3.18 - c->w = sw - 2; 3.19 - c->h = sh - 2 - bh; 3.20 + c->w = sw - 2 * BORDERPX; 3.21 + c->h = sh - 2 * BORDERPX - bh; 3.22 } 3.23 else if(i == 0) { 3.24 c->x = sx; 3.25 c->y = sy + bh; 3.26 - c->w = mw - 2; 3.27 - c->h = sh - 2 - bh; 3.28 + c->w = mw - 2 * BORDERPX; 3.29 + c->h = sh - 2 * BORDERPX - bh; 3.30 } 3.31 else if(h > bh) { 3.32 c->x = sx + mw; 3.33 c->y = sy + (i - 1) * h + bh; 3.34 - c->w = w - 2; 3.35 + c->w = w - 2 * BORDERPX; 3.36 if(i + 1 == n) 3.37 - c->h = sh - c->y - 2; 3.38 + c->h = sh - c->y - 2 * BORDERPX; 3.39 else 3.40 - c->h = h - 2; 3.41 + c->h = h - 2 * BORDERPX; 3.42 } 3.43 else { /* fallback if h < bh */ 3.44 c->x = sx + mw; 3.45 c->y = sy + bh; 3.46 - c->w = w - 2; 3.47 - c->h = sh - 2 - bh; 3.48 + c->w = w - 2 * BORDERPX; 3.49 + c->h = sh - 2 * BORDERPX - bh; 3.50 } 3.51 resize(c, False, TopLeft); 3.52 i++;