Docking allows dragging an area out of a window to empty space to make a new window. And dragging back will close that window if empty. However dragging an area that is alone in its window to empty space does not close the source window so you get a duplicate. This PR just closes that window (when empty) which feels much more natural. Pull Request: https://projects.blender.org/blender/blender/pulls/125201