Fix: Ensure that the "On Top" status is checked when losing the focus.

It used to be checked on being given the focus which is mostly useless.

This commit helps for ticket #3541 but in theory it should just be a safety belt.