Go up the tree when getting reference to focused window.

So if the focused window is a sheet we make sure to take its parent, as that is
the manageable window.

Closes #5