Mercurial > aewl
comparison aewl.c @ 787:eecb13b34511 default tip
Put floating windows on random starting positions
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Fri, 18 Oct 2024 23:42:20 +0200 |
parents | e65be4ffdbdc |
children |
comparison
equal
deleted
inserted
replaced
786:e65be4ffdbdc | 787:eecb13b34511 |
---|---|
1186 Window trans; | 1186 Window trans; |
1187 | 1187 |
1188 c = emallocz(sizeof(Client)); | 1188 c = emallocz(sizeof(Client)); |
1189 c->tag = True; | 1189 c->tag = True; |
1190 c->win = w; | 1190 c->win = w; |
1191 c->x = wa->x; | 1191 if (wa->width < sw) { |
1192 c->y = wa->y; | 1192 c->x = rand() % (sw - wa->width); |
1193 } | |
1194 if (wa->height < sh) { | |
1195 c->y = rand() % (sh - wa->height); | |
1196 } | |
1193 c->w = wa->width; | 1197 c->w = wa->width; |
1194 c->h = wa->height; | 1198 c->h = wa->height; |
1195 if(c->w == sw && c->h == sh) { | 1199 if(c->w == sw && c->h == sh) { |
1196 c->border = 0; | 1200 c->border = 0; |
1197 c->x = sx; | 1201 c->x = sx; |
1275 } | 1279 } |
1276 if(c->w == sw && c->h == sh) | 1280 if(c->w == sw && c->h == sh) |
1277 c->border = 0; | 1281 c->border = 0; |
1278 else | 1282 else |
1279 c->border = BORDERPX; | 1283 c->border = BORDERPX; |
1284 /* move outside window back to original place */ | |
1285 if(c->x > sw) { | |
1286 c->x -= 2 * sw; | |
1287 } | |
1280 /* offscreen appearance fixes */ | 1288 /* offscreen appearance fixes */ |
1281 if(c->x > sw) | 1289 if(c->x > sw) |
1282 c->x = sw - c->w - 2 * c->border; | 1290 c->x = sw - c->w - 2 * c->border; |
1283 if(c->y > sh) | 1291 if(c->y > sh) |
1284 c->y = sh - c->h - 2 * c->border; | 1292 c->y = sh - c->h - 2 * c->border; |