Exactly, you manage the cursors with Awareness. If you have two active browsers, you could do provider.awareness.setLocalState(null) to unregister the local state. But you want to do provider.awareness.setLocalState({ name: 'Jack' }) once the window is active again.
You can, for example, enforce that a cursor is only rendered when the window is currently focused: https://developer.mozilla.org/en-US/docs/Web/API/Document/activeElement. Another approach is to unregister the local cursor when another window registers a cursor. But that would be more difficult implement.