diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2015-11-12 18:33:31 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2015-11-12 18:33:31 +0000 |
commit | c3f8d4aa315a006f9240108735f19768d88d9c5e (patch) | |
tree | 8af8c7603ef7cfb7cffcdc3d4afa4ec06c3f3cef | |
parent | 342de8632b63358d4cbae2f86d8f6b49c5310950 (diff) |
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.
-rw-r--r-- | app/cwm/client.c | 4 | ||||
-rw-r--r-- | app/cwm/kbfunc.c | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/app/cwm/client.c b/app/cwm/client.c index ec46e3958..0f706757f 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.213 2015/11/11 14:22:01 okan Exp $ + * $OpenBSD: client.c,v 1.214 2015/11/12 18:33:30 okan Exp $ */ #include <sys/types.h> @@ -839,6 +839,8 @@ client_getsizehints(struct client_ctx *cc) } cc->hint.incw = MAX(1, cc->hint.incw); cc->hint.inch = MAX(1, cc->hint.inch); + cc->hint.minw = MAX(1, cc->hint.minw); + cc->hint.minh = MAX(1, cc->hint.minh); if (size.flags & PAspect) { if (size.min_aspect.x > 0) diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c index 0ba60c478..b8c8e8504 100644 --- a/app/cwm/kbfunc.c +++ b/app/cwm/kbfunc.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: kbfunc.c,v 1.123 2015/11/12 18:26:41 okan Exp $ + * $OpenBSD: kbfunc.c,v 1.124 2015/11/12 18:33:30 okan Exp $ */ #include <sys/types.h> @@ -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. */ |