summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-03-17 06:24:13 +0000
committerDana Jansens <danakj@orodu.net>2003-03-17 06:24:13 +0000
commit577038b2c7b51329050256b2ed9a22ae7353828f (patch)
treee21b7bc9a5ddf8f5b748b23d0e9d2cf653506979 /python
parent32ec1d1e86f6c2868c53ee824fb8842525c607a9 (diff)
if the window is as big/bigger than the screen with random placement, place it at (0,0)
Diffstat (limited to 'python')
-rw-r--r--python/windowplacement.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/python/windowplacement.py b/python/windowplacement.py
index 56b5320d..afeff2ed 100644
--- a/python/windowplacement.py
+++ b/python/windowplacement.py
@@ -17,8 +17,10 @@ def random(client):
cx, cy, cw, ch = client.area()
sx, sy, sw, sh = ob.Openbox.screenArea(client.desktop())
global _rand
- x = Random().randrange(sx, sw - cw - 1)
- y = Random().randrange(sy, sh - ch - 1)
+ if sw - cw - 1 <= 0: x = 0
+ 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))
def cascade(client):