summaryrefslogtreecommitdiff
path: root/app/cwm
diff options
context:
space:
mode:
authorMarco S Hyman <marc@cvs.openbsd.org>2008-01-03 20:20:21 +0000
committerMarco S Hyman <marc@cvs.openbsd.org>2008-01-03 20:20:21 +0000
commitb455da392fa23410fc35ffc1a576acede7df49a9 (patch)
treeb893961db652fdaaa30f1d2acd94377af2afc3e1 /app/cwm
parent26b47693b3390f90e5929e35168ee8d5231a5b19 (diff)
Adjust initial window placement with any geometry that would place
the window at or over the right or bottom edge. OK oda@
Diffstat (limited to 'app/cwm')
-rw-r--r--app/cwm/client.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/app/cwm/client.c b/app/cwm/client.c
index 32948e247..386be5d95 100644
--- a/app/cwm/client.c
+++ b/app/cwm/client.c
@@ -4,7 +4,7 @@
* Copyright (c) 2004 Marius Aamodt Eriksen <marius@monkey.org>
* All rights reserved.
*
- * $Id: client.c,v 1.8 2008/01/01 22:28:59 marc Exp $
+ * $Id: client.c,v 1.9 2008/01/03 20:20:20 marc Exp $
*/
#include "headers.h"
@@ -91,7 +91,6 @@ client_new(Window win, struct screen_ctx *sc, int mapped)
cc->geom.y = wattr.y;
cc->geom.width = wattr.width;
cc->geom.height = wattr.height;
- cc->geom.height = wattr.height;
cc->cmap = wattr.colormap;
if (wattr.map_state != IsViewable) {
@@ -808,12 +807,16 @@ client_placecalc(struct client_ctx *cc)
if (cc->size->flags & USPosition) {
if (cc->size->x > 0)
x = cc->size->x;
- if (x <= 0 || x >= xmax)
+ if (x < cc->bwidth)
x = cc->bwidth;
+ else if (x > xslack)
+ x = xslack;
if (cc->size->y > 0)
y = cc->size->y;
- if (y <= 0 || y >= ymax)
+ if (y < cc->bwidth)
y = cc->bwidth;
+ else if (y > yslack)
+ y = yslack;
} else {
if (yslack < 0) {
y = cc->bwidth;