projects
/
dana
/
openbox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
32ec1d1
)
if the window is as big/bigger than the screen with random placement, place it at...
author
Dana Jansens
<danakj@orodu.net>
Mon, 17 Mar 2003 06:24:13 +0000
(06:24 +0000)
committer
Dana Jansens
<danakj@orodu.net>
Mon, 17 Mar 2003 06:24:13 +0000
(06:24 +0000)
python/windowplacement.py
patch
|
blob
|
history
diff --git
a/python/windowplacement.py
b/python/windowplacement.py
index 56b5320d21db96247c43a56cf964e6a70e30c5f0..afeff2ed489da4a2f5a1e7150bc40846afbc2737 100644
(file)
--- 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):