A subtlety in restoring previous window position

A common feature for many applications is to record their screen location when they shut down and reopen at that location when relaunched. If implemented naively, a program merely restores from its previous position unconditionally. You run into usability problems with this naive implementation. If a user runs two copies of your program, the two w...