]> Dogcows Code - chaz/openbox/blobdiff - scripts/windowplacement.py
allow a callback to determine if a window should be history-placed
[chaz/openbox] / scripts / windowplacement.py
index 81d260e8188a65bef75f01aaeb2bdaf4b4caf469..aa9271ba512012bc3a1c17f7baffc72156bf8fb8 100644 (file)
@@ -1,6 +1,10 @@
 ############################################################################
 ### Window placement algorithms, choose one of these and ebind it to the ###
 ### ob.EventAction.PlaceWindow event.                                    ###
+###                                                                      ###
+### Also see historyplacement.py for the history placement module which  ###
+### provides an algorithm that can be used in place of, or alongside,    ###
+### these.                                                               ###
 ############################################################################
 
 import otk
@@ -11,11 +15,10 @@ _rand = random.Random()
 
 def random(data):
     if not data.client: return
+    if data.client.positionRequested(): return
     client_area = data.client.area()
     frame_size = data.client.frame.size()
     screen_area = ob.openbox.screen(data.screen).area()
-    print str(screen_area.x()) + " " + str(screen_area.y()) + " " + \
-          str(screen_area.width()) + " " + str(screen_area.height())
     width = screen_area.width() - (client_area.width() +
                                    frame_size.left + frame_size.right)
     height = screen_area.height() - (client_area.height() + 
This page took 0.022677 seconds and 4 git commands to generate.