Finder windows rearrange themselves on restart and wake

For many years (since ca 2007) I’ve used a Samsung Syncmaster 24" as an external display attached to a 2009 Mac Pro and now a 2017 27" iMac.

The Samsung finally died (from exhaustion, probably), and I replaced it with a shiny new LG Ultra HD display.

Now I find that every time I restart the machine or awaken it from sleep, all of the Finder windows (and most of the windows from other apps) have fled the LG display and are huddled together on the iMac’s internal display. That never used to happen with the Samsung.

Any ideas on how to remedy this?

The Samsung was connected to the Mac Pro via DVI, and when I got the iMac I had to add a USB-C-to-DVI adapter.

The LG is now connected to the iMac via a DisplayPort-to-USB-C cable (no adapter involved).