'Delegates layouting actual windows
Parameterer
windows:
windows to layout
mapping:
mapping from layout to ScreenRect for each layout'

def delegate_layout(self, windows, mapping):

    grouped = {}
    for w in windows:
        lay = self.layouts[w]
        if (lay in grouped):
            grouped[lay].append(w)
        else:
            grouped[lay] = [w]
    for (lay, wins) in grouped.items():
        lay.layout(wins, mapping[lay])
