summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2018-02-06 15:05:20 +0000
committerokan <okan>2018-02-06 15:05:20 +0000
commitf3211427c16b755db20bc71ce4074e9fb9aae8af (patch)
tree476afff740e1fdf519d3cd6ade2c9461e74f5235
parent14c17b5f9b8b21860e42cad4fa24d4b87b84a8f1 (diff)
downloadcwm-f3211427c16b755db20bc71ce4074e9fb9aae8af.tar.gz
cwm-f3211427c16b755db20bc71ce4074e9fb9aae8af.tar.xz
cwm-f3211427c16b755db20bc71ce4074e9fb9aae8af.zip
Use screen's saved view instead of re-querying the server.
-rw-r--r--client.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/client.c b/client.c
index 91a708a..45412f3 100644
--- a/client.c
+++ b/client.c
@@ -752,17 +752,12 @@ client_placecalc(struct client_ctx *cc)
 	int			 xslack, yslack;
 
 	if (cc->hint.flags & (USPosition | PPosition)) {
-		int			 wmax, hmax;
-
-		wmax = DisplayWidth(X_Dpy, sc->which);
-		hmax = DisplayHeight(X_Dpy, sc->which);
-
-		if (cc->geom.x >= wmax)
-			cc->geom.x = wmax - cc->bwidth - 1;
+		if (cc->geom.x >= sc->view.w)
+			cc->geom.x = sc->view.w - cc->bwidth - 1;
 		if (cc->geom.x + cc->geom.w + cc->bwidth <= 0)
 			cc->geom.x = -(cc->geom.w + cc->bwidth - 1);
-		if (cc->geom.y >= hmax)
-			cc->geom.x = hmax - cc->bwidth - 1;
+		if (cc->geom.y >= sc->view.h)
+			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);
 	} else {