'Find the last Window under this node
Finds last `Window` by depth-first search, otherwise returns self if
this is a `Window`.'

def get_last_window(self):

    for i in reversed(self.children):
        node = i.get_last_window()
        if node:
            return node
    if isinstance(self, Window):
        return self
