Backport focus fixes from Spartacus (bug 956959)
Merge pull request #413 from muffinresearch/backport-pin-focus-fix

Backport focus fixes from Spartacus (bug 956959)