From 4c437dddb239eb23a6ab4c8a6db256c58d8ef826 Mon Sep 17 00:00:00 2001 From: okan Date: Thu, 5 Jan 2017 21:18:20 +0000 Subject: Ensure client stays inbound on key-based resize; based on logic existing in key-based client move; from Vadim Vygonets. --- kbfunc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kbfunc.c b/kbfunc.c index f9b7456..f3c9112 100644 --- a/kbfunc.c +++ b/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.142 2016/12/06 21:54:10 okan Exp $ + * $OpenBSD: kbfunc.c,v 1.143 2017/01/05 21:18:20 okan Exp $ */ #include @@ -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. */ -- cgit v1.2.3-2-gb3c3