浏览代码

offscreen client appearance fixes

arg@mmvi 19 年之前
父节点
当前提交
28aba061ec
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      client.c

+ 10 - 0
client.c

@@ -281,6 +281,16 @@ resize(Client *c, Bool sizehints, Corner sticky) {
 	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;