Mercurial > dwm-meillo
comparison client.c @ 100:bb3803fb560c
floating clients get random (x,y) offsets now
author | arg@10ksloc.org |
---|---|
date | Wed, 19 Jul 2006 13:22:49 +0200 |
parents | a19556fe83b5 |
children | 17c526ee321c |
comparison
equal
deleted
inserted
replaced
99:a19556fe83b5 | 100:bb3803fb560c |
---|---|
190 } | 190 } |
191 | 191 |
192 void | 192 void |
193 manage(Window w, XWindowAttributes *wa) | 193 manage(Window w, XWindowAttributes *wa) |
194 { | 194 { |
195 int diff; | |
195 Client *c; | 196 Client *c; |
196 XSetWindowAttributes twa; | 197 XSetWindowAttributes twa; |
197 Window trans; | 198 Window trans; |
198 | 199 |
199 c = emallocz(sizeof(Client)); | 200 c = emallocz(sizeof(Client)); |
203 if(c->fy < bh) | 204 if(c->fy < bh) |
204 c->by = c->fy = c->ty += bh; | 205 c->by = c->fy = c->ty += bh; |
205 c->bw = c->fw = c->tw = wa->width; | 206 c->bw = c->fw = c->tw = wa->width; |
206 c->fh = c->th = wa->height; | 207 c->fh = c->th = wa->height; |
207 c->bh = bh; | 208 c->bh = bh; |
209 | |
210 diff = sw - c->fw; | |
211 c->fx = sx + (random() % diff ? diff : 1); | |
212 diff = sh - c->fh; | |
213 c->fy = sx + (random() % diff ? diff : 1); | |
214 | |
208 c->border = 1; | 215 c->border = 1; |
209 c->proto = getproto(c->win); | 216 c->proto = getproto(c->win); |
210 setsize(c); | 217 setsize(c); |
211 XSelectInput(dpy, c->win, | 218 XSelectInput(dpy, c->win, |
212 StructureNotifyMask | PropertyChangeMask | EnterWindowMask); | 219 StructureNotifyMask | PropertyChangeMask | EnterWindowMask); |