aboutsummaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorokan2018-02-06 15:05:20 +0000
committerokan2018-02-06 15:05:20 +0000
commit54038380504e5bb95e059dfba5aa74e9f591123b (patch)
tree9fe1ccf438391547510362938faedac61b3822a9 /client.c
parent69612bdea7ce4935bf16e616320045742af5ca20 (diff)
downloadcwm-54038380504e5bb95e059dfba5aa74e9f591123b.tar.gz
Use screen's saved view instead of re-querying the server.
Diffstat (limited to 'client.c')
-rw-r--r--client.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/client.c b/client.c
index 11eac06..1955f4a 100644
--- a/client.c
+++ b/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.244 2017/12/29 18:50:43 okan Exp $
+ * $OpenBSD: client.c,v 1.245 2018/02/06 15:05:20 okan Exp $
*/
#include <sys/types.h>
@@ -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 {