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