X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=scripts%2Fhistoryplacement.py;h=fb1dd35b4d4cb55d70dce4a963d0d0f780973b39;hb=74c683ee5fb232d7fe9f517b21ffd9ee50872dce;hp=cb9fb96cc77877b4528b012722ef008659708193;hpb=feaf3ac4e5847d27e3747b09e7443915afa97b0b;p=chaz%2Fopenbox 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')