Wherever the windows are displayed, they are always closed in the same manner. In the right side of the title bar of the window, one small button is displayed, looking like a cross. Clicking on this button will close the window.
An alternative way to close the window is to double-click on the icon to the left of the title bar of the window. Not all windows have such an icon, but editors do for instance.
When a window is closed, the focus is given to the window of the same part of the MDI (each of the docks or the middle area) that previously had the focus. Therefore, if you simply open an editor as a result of a cross-reference query, you can simply close that editor to go back to where you were before.
Alternatively, you can also select the window by clicking anywhere in
its title bar, and then select the menu Window->Close