Fix bug with parent window never becoming key