offscreen client appearance fixes
authorarg@mmvi
Fri, 15 Sep 2006 10:54:32 +0200
changeset 465 590575d080fe
parent 464 bd32d89ed9d5
child 466 ad3fa2d18542
offscreen client appearance fixes
client.c
--- a/client.c	Fri Sep 15 10:49:05 2006 +0200
+++ b/client.c	Fri Sep 15 10:54:32 2006 +0200
@@ -281,6 +281,16 @@
 	if(sticky == BotLeft || sticky == BotRight)
 		c->y = bottom - c->h;
 
+	/* offscreen appearance fixes */
+	if(c->x + c->w < 0)
+		c->x = 0;
+	if(c->y + c->h < bh)
+		c->y = bh;
+	if(c->x > sw)
+		c->x = sw - c->w;
+	if(c->y > sh)
+		c->y = sh - c->h;
+
 	resizetitle(c);
 	wc.x = c->x;
 	wc.y = c->y;