floating clients get random (x,y) offsets now
authorarg@10ksloc.org
Wed, 19 Jul 2006 13:22:49 +0200
changeset 100 bb3803fb560c
parent 99 a19556fe83b5
child 101 17c526ee321c
floating clients get random (x,y) offsets now
client.c
--- a/client.c	Wed Jul 19 11:31:04 2006 +0200
+++ b/client.c	Wed Jul 19 13:22:49 2006 +0200
@@ -192,6 +192,7 @@
 void
 manage(Window w, XWindowAttributes *wa)
 {
+	int diff;
 	Client *c;
 	XSetWindowAttributes twa;
 	Window trans;
@@ -205,6 +206,12 @@
 	c->bw = c->fw = c->tw = wa->width;
 	c->fh = c->th = wa->height;
 	c->bh = bh;
+
+	diff = sw - c->fw;
+	c->fx = sx + (random() % diff ? diff : 1);
+	diff = sh - c->fh;
+	c->fy = sx + (random() % diff ? diff : 1);
+
 	c->border = 1;
 	c->proto = getproto(c->win);
 	setsize(c);