summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2017-01-05 21:18:20 +0000
committerokan <okan>2017-01-05 21:18:20 +0000
commit96918a06e68bc9940a9205b2c312707f09c415bf (patch)
tree9e4db5e3db2d6e6329ad736fb30f5dfe1cb62aa1
parent613d11434a7e950c62b68829e583fabb84c73238 (diff)
downloadcwm-96918a06e68bc9940a9205b2c312707f09c415bf.tar.gz
cwm-96918a06e68bc9940a9205b2c312707f09c415bf.tar.xz
cwm-96918a06e68bc9940a9205b2c312707f09c415bf.zip
Ensure client stays inbound on key-based resize; based on logic existing in
key-based client move; from Vadim Vygonets.
-rw-r--r--kbfunc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kbfunc.c b/kbfunc.c
index 134a8e7..befaf64 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -156,6 +156,10 @@ kbfunc_client_resize(void *ctx, union arg *arg, enum xev xev)
 		cc->geom.w = cc->hint.minw;
 	if ((cc->geom.h += my * cc->hint.inch) < cc->hint.minh)
 		cc->geom.h = cc->hint.minh;
+	if (cc->geom.x + cc->geom.w < 0)
+		cc->geom.x = -cc->geom.w;
+	if (cc->geom.y + cc->geom.h < 0)
+		cc->geom.y = -cc->geom.h;
 	client_resize(cc, 1);
 
 	/* Make sure the pointer stays within the window. */