Fix view jump when focus returns to window

by remembering the focus state of the last frame