The current behaviour is that if you have more than one frame (X window) on workspace A, switching to workspace A from another workspace always focuses the first frame in the list. This is not always desirable: imagine a workspace A with frames 0 and 1, where 0 displays some reference material and 1 is the document being worked on. If one is writing in frame 1, then switches to some workspace B and back, one would like to immediately continue working. However, the focus is now on frame 0, so one is forced to use the window switcher before continuing work.
I propose introducing a variable to hold the (index of the) currently focused frame of a workspace when leaving said workspace, to restore focus when returning to the workspace. If someone can point me to the code for focusing, I am happy to implement this behaviour myself and create a pull request.