changeset 465:590575d080fe

offscreen client appearance fixes
author arg@mmvi
date Fri, 15 Sep 2006 10:54:32 +0200
parents bd32d89ed9d5
children ad3fa2d18542
files client.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;