]>
Dogcows Code - chaz/openbox/blob - scripts/windowplacement.py
aa9271ba512012bc3a1c17f7baffc72156bf8fb8
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 if data
.client
.positionRequested(): return
19 client_area
= data
.client
.area()
20 frame_size
= data
.client
.frame
.size()
21 screen_area
= ob
.openbox
.screen(data
.screen
).area()
22 width
= screen_area
.width() - (client_area
.width() +
23 frame_size
.left
+ frame_size
.right
)
24 height
= screen_area
.height() - (client_area
.height() +
25 frame_size
.top
+ frame_size
.bottom
)
27 x
= _rand
.randrange(screen_area
.x(), width
-1)
28 y
= _rand
.randrange(screen_area
.y(), height
-1)
29 data
.client
.move(x
, y
)
31 print "Loaded windowplacement.py"
This page took 0.037407 seconds and 4 git commands to generate.