Duplicate file opening on desktop

This issue has been going on for sometime over a year, through Mojave, and now Catalina.

When opening an Xcode project either by double clicking or command-O, sometimes, but not always the project will open twice on the screen, one on top of the other. Usually when trying to pull the top copy away, Xcode will crash. I have tried emptying the DerivedData folder but this doesn't help.

Duplicate file opening on desktop
 
 
Q