]>
Dogcows Code - chaz/openbox/blob - scripts/windowplacement.py
1 ############################################################################
2 ### Window placement algorithms, choose one of these and ebind it to the ###
3 ### ob.EventAction.PlaceWindow event. ###
4 ############################################################################
10 _rand
= random
.Random()
13 if not data
.client
: return
14 client_area
= data
.client
.area()
15 frame_size
= data
.client
.frame
.size()
16 screen_area
= ob
.openbox
.screen(data
.screen
).area()
17 width
= screen_area
.width() - (client_area
.width() +
18 frame_size
.left
+ frame_size
.right
)
19 height
= screen_area
.height() - (client_area
.height() +
20 frame_size
.top
+ frame_size
.bottom
)
22 x
= _rand
.randrange(screen_area
.x(), width
-1)
23 y
= _rand
.randrange(screen_area
.y(), height
-1)
24 data
.client
.move(x
, y
)
26 print "Loaded windowplacement.py"
This page took 0.039633 seconds and 4 git commands to generate.