aboutsummaryrefslogtreecommitdiffstats
path: root/kbfunc.c
diff options
context:
space:
mode:
authorokan2017-01-05 21:18:20 +0000
committerokan2017-01-05 21:18:20 +0000
commit4c437dddb239eb23a6ab4c8a6db256c58d8ef826 (patch)
tree3de37ee013dc9ff8b9b324a27ca537dbda35a1e3 /kbfunc.c
parent5ac58b2ef78cec185ee3ca219a9dd171f02313c2 (diff)
downloadcwm-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.c6
1 files changed, 5 insertions, 1 deletions
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 <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. */