'Focus the window that had focus before the current one got it.
Repeated calls to this function would basically continuously switch
between the last two focused windows. Do nothing if less than 2
windows ever received focus.'

def cmd_focus_back(self):

    try:
        win = self.focusHistory[(-2)]
    except IndexError:
        pass
    else:
        self.focus(win)
