The browse mode cursor is no longer positioned incorrectly when leaving a dialog or application inside the document.
This occurred because VirtualBuffer ignores a focus event if it is for the same object that was last focused. This is to avoid mistakenly moving the cursor when switching applications, tabs, etc.
Now, such a focus event is only ignored if the document is being entered from outside (as opposed to returning from a dialog or application inside).
Re #3145.