It looks like the problem is gone. Coming out of sleep mode restores the desktop correctly, apps are still on the assigned screens.
I installed the file igfx_win10_100.9313.exe from the page Riider pointed out. Thanks.
A side effect is that Windows is not 'Activated' after I installed the intel package. During installation of this Windows 10 a 'Digital license" was installed linked to my MS account. Searching online, one MS site stated that in order to solve the digital license, I need to reinstall Windows 10 so it will be linked again to my MS account. Kind of a headache reinstalling the complete system. For now i have it activated with a KMS key for 180 days.
This problem exists since I built this system 6 months ago. If the power saver kicks in, aka "turn screen off" and I quickly get out of the screensaver all is still OK; no apps moved.
I have the impression that after some time Windows or the GPU driver acts as if the second monitor is disconnected. And moves open apps to the primary screen.
However after coming out of power-saver the desktop environment is not modified; all shortcuts are still in its original place on both screens.
My previous build had a GPU card with screens connected via HDMI and VGA without converters. incidentally also the primary windows monitor was screen #2 and secondary was screen #1.
What I meant was, have you always had the problem with sleep mode & the dual setup or is it a new problem? If it's new, did you change or update anything?
I have a dual setup as well. Primary is HDMI, 2nd monitor is DisplayPort (no adapter). The 2nd screen is to the left of the primary. If I right click on the desktop & select Display settings, the second monitor is #1 & the primary is #2. Multiple displays is set to 'Extend these displays' & the box for 'Make this my main display' is checked for screen #2.
The dual setup works fine. It only happens when the second screen goes into sleep mode (power setting in windows). Coming out of sleep mode, all open open windows (browsers in this case) are on primary screen as if something dragged the browsers to the primary screen.
HDMI and Display-port are used and cables are new and properly connected.
The secondary display cable is DisplayPort-to- HDMI (no DisplayPort on screens available)