summary refs log tree commit diff
path: root/kbfunc.c
diff options
context:
space:
mode:
authorokan <okan>2015-11-12 18:33:30 +0000
committerokan <okan>2015-11-12 18:33:30 +0000
commit4aca2b876485fa011298c9d7c0fe5b296b2ed122 (patch)
tree7e5a64d32500449bb7ee1f2e731baf3591b6717a /kbfunc.c
parent9a48836ceb40313cd12c05781d57f291401de7b0 (diff)
downloadcwm-4aca2b876485fa011298c9d7c0fe5b296b2ed122.tar.gz
cwm-4aca2b876485fa011298c9d7c0fe5b296b2ed122.tar.xz
cwm-4aca2b876485fa011298c9d7c0fe5b296b2ed122.zip
If a client sets hints, honor them for kb resize requests, just like we
do for mouse based resize requests.

Based on a patch from Vadim Vygonets.
Diffstat (limited to 'kbfunc.c')
-rw-r--r--kbfunc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kbfunc.c b/kbfunc.c
index 121ae7d..e5e0708 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -143,10 +143,10 @@ kbfunc_client_resize(struct client_ctx *cc, union arg *arg)
 
 	kbfunc_amount(arg->i, &mx, &my);
 
-	if ((cc->geom.w += mx) < 1)
-		cc->geom.w = 1;
-	if ((cc->geom.h += my) < 1)
-		cc->geom.h = 1;
+	if ((cc->geom.w += mx * cc->hint.incw) < cc->hint.minw)
+		cc->geom.w = cc->hint.minw;
+	if ((cc->geom.h += my * cc->hint.inch) < cc->hint.minh)
+		cc->geom.h = cc->hint.minh;
 	client_resize(cc, 1);
 
 	/* Make sure the pointer stays within the window. */