summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2018-11-08 15:49:43 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2018-11-08 15:49:43 +0000
commitcf5f0b5eb4bb3fc42ef3e24fe72a8634bcac79d0 (patch)
tree69a2dd06fa551e185e381e3bacf73bc67833dcfc /app
parent3b1b321f1434d697284e77d8dc20654574682784 (diff)
Use the original client border width to adjust initial placement of clients
containing {P,US}Position requests where they are explicitly set to 'ignore' in cwmrc(5); clients are unaware that their border will be altered (removed in this case) when calcuating position and thus end up a factor of their original border width off once mapped by cwm(1). cwm(1) will essentially shift the client to the edge if the original request's position and border match. Window offset noticed by at least Andre Stoebe via bugs@, and others since (and likely before). Thanks!
Diffstat (limited to 'app')
-rw-r--r--app/cwm/calmwm.h3
-rw-r--r--app/cwm/client.c9
2 files changed, 10 insertions, 2 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h
index 8aee7602b..ee168241c 100644
--- a/app/cwm/calmwm.h
+++ b/app/cwm/calmwm.h
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: calmwm.h,v 1.361 2018/07/16 14:19:23 okan Exp $
+ * $OpenBSD: calmwm.h,v 1.362 2018/11/08 15:49:42 okan Exp $
*/
#ifndef _CALMWM_H_
@@ -130,6 +130,7 @@ struct client_ctx {
Window win;
Colormap colormap;
int bwidth; /* border width */
+ int obwidth; /* original border width */
struct geom geom, savegeom, fullgeom;
struct {
long flags; /* defined hints */
diff --git a/app/cwm/client.c b/app/cwm/client.c
index 1955f4a9f..11fb8fdc6 100644
--- a/app/cwm/client.c
+++ b/app/cwm/client.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: client.c,v 1.245 2018/02/06 15:05:20 okan Exp $
+ * $OpenBSD: client.c,v 1.246 2018/11/08 15:49:42 okan Exp $
*/
#include <sys/types.h>
@@ -96,6 +96,7 @@ client_init(Window win, struct screen_ctx *sc, int active)
cc->ptr.y = cc->geom.h / 2;
cc->colormap = wattr.colormap;
+ cc->obwidth = wattr.border_width;
if (wattr.map_state != IsViewable) {
client_placecalc(cc);
@@ -760,6 +761,12 @@ client_placecalc(struct client_ctx *cc)
cc->geom.x = sc->view.h - cc->bwidth - 1;
if (cc->geom.y + cc->geom.h + cc->bwidth <= 0)
cc->geom.y = -(cc->geom.h + cc->bwidth - 1);
+ if (cc->flags & CLIENT_IGNORE) {
+ if (((cc->obwidth * 2) + cc->geom.x + cc->geom.w) == sc->view.w)
+ cc->geom.x += cc->obwidth * 2;
+ if (((cc->obwidth * 2) + cc->geom.y + cc->geom.h) == sc->view.h)
+ cc->geom.y += cc->obwidth * 2;
+ }
} else {
struct geom area;
int xmouse, ymouse;