Windows on wrong screen after waking up monitors

I’ve an external monitor connected to the laptop. Energy saving settings is set to switch the monitor off after 10 min (default). If I unlock after 10 min, most windows are shown on the laptop screen and not on the external monitor like before.
I think that the problem occurs since one of the last updates. At least I never noticed it before.
Any ideas how to solve this?

That would be handled by your desktop environment’s window manager.

So only some of them move to the laptop monitor?

E.g. Dolphin remains on the main monitor but Thunderbird appears on the laptop.