]> Dogcows Code - chaz/openbox/commitdiff
if the window is as big/bigger than the screen with random placement, place it at...
authorDana Jansens <danakj@orodu.net>
Mon, 17 Mar 2003 06:24:13 +0000 (06:24 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 17 Mar 2003 06:24:13 +0000 (06:24 +0000)
python/windowplacement.py

index 56b5320d21db96247c43a56cf964e6a70e30c5f0..afeff2ed489da4a2f5a1e7150bc40846afbc2737 100644 (file)
@@ -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):
This page took 0.024163 seconds and 4 git commands to generate.