Windows on second monitor moves to primary monitor after sleep/lock

A similar case on Microsoft Community mentioned a workaround, have a try.

Start Control Panel --> Device Manager Select View --> Show hidden devices Expand Computer --> Monitors

When you expand the Monitors you will see your current monitor (highlighted) and all the disconnected monitors (greyed out). You may see monitors with "non-PNP" and "PNP" listed as well. I believe these are aliases to your current monitor (at a lower resolution) before Windows installed drivers for it.
I uninstalled ALL the greyed out monitors. Right-click on these monitors and select uninstall. Keep only the highlighted monitor you are currently using.
Uninstall all greyed out monitors (even non-PNP and PNP monitors) Reboot your system. After doing this my windows don't resize after my monitor goes to sleep. You can quickly test this by temporarily setting your monitor sleep time to 1 minute.

Settings --> System --> Power & Sleep --> Screen [1 minute]

https://answers.microsoft.com/en-us/windows/forum/windows_10-hardware-winpc/windows-10-multiple-display-windows-are-moved-and/2b9d5a18-45cc-4c50-b16e-fd95dbf27ff3


TL;DR - if the windows are moving to a VGA connected monitor, it looks like there are three options, in order of "fixed" to "workaround":

  • Change the connection to that monitor to something other that VGA (changing to DisplayPort connection fixed it for me)
  • Make the VGA monitor the Primary Monitor.
  • Unplug the VGA monitor, then plug it back on each resume.

I had this problem - all the windows shifted to one monitor on resume from sleep / hibernate. The LCD monitor the windows shifted to was connected by VGA cable - my primary monitor is connected by DisplayPort, plus the laptop display.

Turning off the VGA monitor didn't force the windows to shift back to the primary monitor, but unplugging the VGA monitor did force the windows back.

I guess that the VGA connection does not report that the monitor is actually off, just that there is a monitor present, and Windows detects it before the DisplayPort connected monitor or even the internal laptop display, so moves the Windows to the VGA monitor.

Fortunately, the VGA connected monitor also has DisplayPort connection, so I changed the monitor to DisplayPort, and the problem was resolved.


The currently accepted answer by Origami does not work for me.

But this workaround helps, although far from a complete solution.

Prerequisites:

  • system must be locked before going to sleep (lock it by the key combination WINDOWS-L and let it then go to sleep or make sure it locks by itself before sleeping - maybe with screensaver settings, I always lock manually, so did not test this; just letting the PC go to sleep (unlocked) will not work, even if it asks for the password when waking up)

Workaround:

  • when the monitors are sleeping, move the mouse
  • wait until the monitors turn on
  • the monitors might blink once or twice, just give them good 5 or 10 seconds, so they are 100% on and detected by Windows
  • press a key, mouse button or ctrl-alt-delete, depending on Windows configuration, so that the login screen appears, asking for password
  • enter password and unlock the PC

Result:

  • windows are where they were left

Sometimes only some windows stay at their position and some get moved to the main display even if you do the described workaround. I guess there is nothing more to do than wait for Microsoft to fix this.