diff options
author | okan | 2017-01-05 21:18:20 +0000 |
---|---|---|
committer | okan | 2017-01-05 21:18:20 +0000 |
commit | 4c437dddb239eb23a6ab4c8a6db256c58d8ef826 (patch) | |
tree | 3de37ee013dc9ff8b9b324a27ca537dbda35a1e3 /kbfunc.c | |
parent | 5ac58b2ef78cec185ee3ca219a9dd171f02313c2 (diff) | |
download | cwm-4c437dddb239eb23a6ab4c8a6db256c58d8ef826.tar.gz |
Ensure client stays inbound on key-based resize; based on logic existing in
key-based client move; from Vadim Vygonets.
Diffstat (limited to 'kbfunc.c')
-rw-r--r-- | kbfunc.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 <sys/types.h> @@ -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. */ |