]>
Dogcows Code - chaz/openbox/blob - scripts/windowplacement.py
070cc0ee2699f890a0e7d97141d2086bb2404c80
1 ############################################################################
2 ### Window placement algorithms, choose one of these and ebind it to the ###
3 ### ob.EventAction.PlaceWindow event. ###
5 ### Also see historyplacement.py for the history placement module which ###
6 ### provides an algorithm that can be used in place of, or alongside ###
8 ############################################################################
14 _rand
= random
.Random()
17 if not data
.client
: return
18 client_area
= data
.client
.area()
19 frame_size
= data
.client
.frame
.size()
20 screen_area
= ob
.openbox
.screen(data
.screen
).area()
21 width
= screen_area
.width() - (client_area
.width() +
22 frame_size
.left
+ frame_size
.right
)
23 height
= screen_area
.height() - (client_area
.height() +
24 frame_size
.top
+ frame_size
.bottom
)
26 x
= _rand
.randrange(screen_area
.x(), width
-1)
27 y
= _rand
.randrange(screen_area
.y(), height
-1)
28 data
.client
.move(x
, y
)
30 print "Loaded windowplacement.py"
This page took 0.034706 seconds and 4 git commands to generate.