Created a 'focus chain.'

This makes focusing a little more useful, since when a window is destroyed,
the previously focused window is focused, and so on. For example, when
a dialog window is closed, the window that spawned the dialog is focused.

This helps avoid 'disappearing window syndrome' when a window which was
focused recently is put below a window which was focused less recently.