fix infinite recursion on focus. fixes #816