summaryrefslogtreecommitdiff
path: root/scripts/historyplacement.py
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-03-16 21:11:39 +0000
committerDana Jansens <danakj@orodu.net>2003-03-16 21:11:39 +0000
commitf8a47de5ec444c452093371e3db16857eb39a490 (patch)
tree31db2567842d98232775f9980f7a8d2586c0ac71 /scripts/historyplacement.py
parent8ba0586bcbdc7fe9648f1063812126d71a041670 (diff)
merge the C branch into HEAD
Diffstat (limited to 'scripts/historyplacement.py')
-rw-r--r--scripts/historyplacement.py45
1 files changed, 16 insertions, 29 deletions
diff --git a/scripts/historyplacement.py b/scripts/historyplacement.py
index cb9fb96c..fb1dd35b 100644
--- a/scripts/historyplacement.py
+++ b/scripts/historyplacement.py
@@ -48,17 +48,6 @@ config.add('historyplacement',
'enum',
windowplacement.random,
options = windowplacement.export_functions)
-config.add('historyplacement',
- 'confirm_callback',
- 'Confirm Placement Callback',
- "A function which will be called before attempting to place a " + \
- "window via history. If the function returns true, then an " + \
- "attempt will be made to place the window. If it returns false, " +\
- "the 'Fallback Algorithm' will be directly applied instead. The " +\
- "function must take 1 argument, which will be the callback data " +\
- "which was passed to invoke the window placement.",
- 'function',
- None)
###########################################################################
@@ -152,25 +141,23 @@ def _place(data):
if data.client.positionRequested(): return
state = _create_state(data)
try:
- confirm = config.get('historyplacement', 'confirm_callback')
- if not confirm or confirm(data):
- print "looking for : " + state.appname + " : " + \
- state.appclass + " : " + state.role
-
- i = _find(data.screen, state)
- if i >= 0:
- coords = _data[data.screen][i]
- print "Found in history ("+str(coords.x)+","+\
- str(coords.y)+")"
- if not (config.get('historyplacement', 'dont_duplicate') \
- and coords.placed):
- data.client.move(coords.x, coords.y)
- coords.placed = 1
- return
- else:
- print "Already placed another window there"
+ print "looking for : " + state.appname + " : " + \
+ state.appclass + " : " + state.role
+
+ i = _find(data.screen, state)
+ if i >= 0:
+ coords = _data[data.screen][i]
+ print "Found in history ("+str(coords.x)+","+\
+ str(coords.y)+")"
+ if not (config.get('historyplacement', 'dont_duplicate') \
+ and coords.placed):
+ data.client.move(coords.x, coords.y)
+ coords.placed = 1
+ return
else:
- print "No match in history"
+ print "Already placed another window there"
+ else:
+ print "No match in history"
except TypeError:
pass
fallback = config.get('historyplacement', 'fallback')