about summary refs log tree commit diff
path: root/kbfunc.c
diff options
context:
space:
mode:
authorokan <okan>2017-01-05 21:18:20 +0000
committerokan <okan>2017-01-05 21:18:20 +0000
commitb6a5b876e7d92d0ff4ef7928b83f740c2dbcc35d (patch)
tree81df962f2df5de617ab966fecf9c670f7c914ced /kbfunc.c
parent44216b65c95ea5e93467bb5c923010fc44519ee2 (diff)
parent96918a06e68bc9940a9205b2c312707f09c415bf (diff)
downloadcwm-b6a5b876e7d92d0ff4ef7928b83f740c2dbcc35d.tar.gz
cwm-b6a5b876e7d92d0ff4ef7928b83f740c2dbcc35d.tar.xz
cwm-b6a5b876e7d92d0ff4ef7928b83f740c2dbcc35d.zip
cvsimport
* refs/heads/master:
  Ensure client stays inbound on key-based resize; based on logic existing in key-based client move; from Vadim Vygonets.
  When a window has a user or program specified position, ensure the edge of the final position is at least viewable and warp'able by the difference of bwidth; prevents mapping windows completely off the virtual screen.
Diffstat (limited to 'kbfunc.c')
-rw-r--r--kbfunc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kbfunc.c b/kbfunc.c
index f105e6b..58b3e18 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -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. */