if the window is as big/bigger than the screen with random placement, place it at (0,0)

This commit is contained in:
Dana Jansens 2003-03-17 06:24:13 +00:00
parent 32ec1d1e86
commit 577038b2c7

View file

@ -17,8 +17,10 @@ def random(client):
cx, cy, cw, ch = client.area() cx, cy, cw, ch = client.area()
sx, sy, sw, sh = ob.Openbox.screenArea(client.desktop()) sx, sy, sw, sh = ob.Openbox.screenArea(client.desktop())
global _rand global _rand
x = Random().randrange(sx, sw - cw - 1) if sw - cw - 1 <= 0: x = 0
y = Random().randrange(sy, sh - ch - 1) else: x = Random().randrange(sx, sw - cw - 1)
if (sh - ch - 1 <= 0: y = 0
else: y = Random().randrange(sy, sh - ch - 1)
client.setArea((x, y, cw, ch)) client.setArea((x, y, cw, ch))
def cascade(client): def cascade(client):